Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Sync with facebook/nuclide
Browse files Browse the repository at this point in the history
* nuclide-sync:
  Nuclide VSP Debugging: Respect supportsThreadCausedFocus experimental client flags
  Nuclide VSP Debugger: Clear sourceReference breakpoints at the end of the debug session
  Track when outline view filter changes
  Add additional tracking to diagnostics
  Track when diagnostics popups are shown
  Allow multi-line input in debugger console
  Move required stylesheet to modules for atom-ide-ui
  Flow upgrade to v0.67.1
  Nuclide debugger: add experimental support for TerminateThread
  fix redundancy for features in user's config.json
  yarn add -D -E [email protected]
  Track go-to-definition actions
  Bump nuclide modules to 0.5.1-dev
  • Loading branch information
matthewwithanm committed Mar 14, 2018
2 parents 6d391a3 + ccafc0d commit 4823e23
Show file tree
Hide file tree
Showing 28 changed files with 201 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ sketchy-null=error
sketchy-null-bool=off

[version]
0.66.0
0.67.1
9 changes: 9 additions & 0 deletions flow-libs/vscode-debugprotocol.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ declare module 'vscode-debugprotocol' {
supportsVariablePaging?: boolean,
/** Client supports the runInTerminal request. */
supportsRunInTerminalRequest?: boolean,
/** Experimental: Client supports the `threadCausedFocus` stopped event attribute . */
// https://github.com/Microsoft/vscode-debugadapter-node/issues/147
supportsThreadCausedFocus?: boolean,
};

/** Response to 'initialize' request. */
Expand Down Expand Up @@ -1079,6 +1082,12 @@ declare module 'vscode-debugprotocol' {
* This is not part of the standard Visual Studio Code debug protocol.
*/
supportsContinueToLocation?: boolean,

/** Experimental support for terminate thread - this is currently proposed as
* an addition to the protocol but not added yet.
* Tracked by VS Code issue: https://github.com/Microsoft/vscode-debugadapter-node/issues/150
*/
supportsTerminateThread?: boolean,
};

/** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */
Expand Down
8 changes: 4 additions & 4 deletions modules/atom-ide-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atom-ide-ui",
"version": "0.5.0",
"version": "0.5.1-dev",
"description": "A suite of language service UIs for Atom.",
"author": "NEEDS OWNER",
"license": "BSD-3-Clause",
Expand All @@ -23,9 +23,9 @@
"immutable": "4.0.0-rc.9",
"log4js": "1.1.1",
"marked": "0.3.9",
"nuclide-commons": "0.5.1",
"nuclide-commons-atom": "0.5.0",
"nuclide-commons-ui": "0.5.0",
"nuclide-commons": "0.5.1-dev",
"nuclide-commons-atom": "0.5.1-dev",
"nuclide-commons-ui": "0.5.1-dev",
"nullthrows": "1.0.0",
"react": "16.2.0",
"react-dom": "16.2.0",
Expand Down
34 changes: 34 additions & 0 deletions modules/atom-ide-ui/pkg/atom-ide-console/lib/ui/ConsoleView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import invariant from 'assert';
import shallowEqual from 'shallowequal';
import recordsChanged from '../recordsChanged';
import StyleSheet from 'nuclide-commons-ui/StyleSheet';
import classnames from 'classnames';

type Props = {
displayableRecords: Array<DisplayableRecord>,
Expand Down Expand Up @@ -61,6 +62,7 @@ type Props = {

type State = {
unseenMessages: boolean,
promptBufferChanged: boolean,
};

// Maximum time (ms) for the console to try scrolling to the bottom.
Expand All @@ -85,6 +87,7 @@ export default class ConsoleView extends React.Component<Props, State> {
super(props);
this.state = {
unseenMessages: false,
promptBufferChanged: false,
};
this._disposables = new UniversalDisposable();
this._isScrolledNearBottom = true;
Expand Down Expand Up @@ -236,11 +239,39 @@ export default class ConsoleView extends React.Component<Props, State> {
/>
</div>
{this._renderPrompt()}
{this._renderMultilineTip()}
</div>
</div>
);
}

_renderMultilineTip(): ?React.Element<any> {
const {currentExecutor} = this.props;
if (currentExecutor == null) {
return;
}
const keyCombo =
process.platform === 'darwin' ? (
// Option + Enter on Mac
<span>&#8997; + &#9166;</span>
) : (
// Shift + Enter on Windows and Linux.
<span>Shift + Enter</span>
);

return (
<div
className={classnames(
'console-multiline-tip',
this.state.promptBufferChanged
? 'console-multiline-tip-dim'
: 'console-multiline-tip-not-dim',
)}>
Tip: {keyCombo} to insert a newline
</div>
);
}

_renderPrompt(): ?React.Element<any> {
const {currentExecutor} = this.props;
if (currentExecutor == null) {
Expand All @@ -254,6 +285,9 @@ export default class ConsoleView extends React.Component<Props, State> {
onSubmit={this._executePrompt}
history={this.props.history}
watchEditor={this.props.watchEditor}
onDidTextBufferChange={() => {
this.setState({promptBufferChanged: true});
}}
/>
</div>
);
Expand Down
8 changes: 5 additions & 3 deletions modules/atom-ide-ui/pkg/atom-ide-console/lib/ui/InputArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Props = {
scopeName: ?string,
history: Array<string>,
watchEditor: ?WatchEditorFunction,
onDidTextBufferChange?: (event: atom$AggregatedTextEditEvent) => mixed,
};

type State = {
Expand Down Expand Up @@ -97,13 +98,13 @@ export default class InputArea extends React.Component<Props, State> {
event.preventDefault();
event.stopImmediatePropagation();

if (event.ctrlKey) {
if (event.ctrlKey || event.altKey || event.shiftKey) {
editor.insertNewline();
return;
}

this._submit();
} else if (event.which === UP_KEY_CODE) {
} else if (event.which === UP_KEY_CODE && editor.getLineCount() <= 1) {
if (this.props.history.length === 0 || isAutocompleteOpen) {
return;
}
Expand All @@ -121,7 +122,7 @@ export default class InputArea extends React.Component<Props, State> {
editor.setText(
this.props.history[this.props.history.length - historyIndex - 1],
);
} else if (event.which === DOWN_KEY_CODE) {
} else if (event.which === DOWN_KEY_CODE && editor.getLineCount() <= 1) {
if (this.props.history.length === 0 || isAutocompleteOpen) {
return;
}
Expand Down Expand Up @@ -154,6 +155,7 @@ export default class InputArea extends React.Component<Props, State> {
lineNumberGutterVisible={false}
onConfirm={this._submit}
onInitialized={this._attachLabel}
onDidTextBufferChange={this.props.onDidTextBufferChange}
/>
</div>
);
Expand Down
19 changes: 19 additions & 0 deletions modules/atom-ide-ui/pkg/atom-ide-console/styles/console.less
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,19 @@
margin-top: auto;
}

.console-multiline-tip {
padding: 0px 0px 5px 100px;
font-size: 0.8em;
}

.console-multiline-tip-dim {
opacity: 0.5;
}

.console-multiline-tip-not-dim {
opacity: 0.8;
}

.console-prompt-wrapper {
display: flex;
align-items: center;
Expand Down Expand Up @@ -510,3 +523,9 @@
.console-process-starting-spinner {
margin: 0 0.5em 0 0.5em;
}

.console-table-row-wrapper {
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 3px;
}
6 changes: 6 additions & 0 deletions modules/atom-ide-ui/pkg/atom-ide-definitions/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ class Activation {
line: definition.position.row,
column: definition.position.column,
});
analytics.track('go-to-definition', {
path: definition.path,
line: definition.position.row,
column: definition.position.column,
from: editor.getPath(),
});
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export class DiagnosticsViewModel {
nextHiddenTypes.add(type);
}
this._model.setState({hiddenGroups: nextHiddenTypes});
analytics.track('diagnostics-panel-change-filter');
};

_handleTextFilterChange = (value: RegExpFilterChange): void => {
Expand All @@ -228,6 +229,7 @@ export class DiagnosticsViewModel {
this._model.setState({
textFilter: {text, isRegExp, invalid, pattern},
});
analytics.track('diagnostics-panel-change-filter');
};

_filterDiagnostics(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export function applyUpdateToEditor(
// TextEditor.
if (update.messages.length > 0) {
gutter.show();
analytics.track('diagnostics-show-editor-diagnostics');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {CodeAction} from '../../../atom-ide-code-actions/lib/types';

import * as React from 'react';
import classnames from 'classnames';
import analytics from 'nuclide-commons-atom/analytics';
import {mapUnion} from 'nuclide-commons/collection';
import {DiagnosticsMessage} from './DiagnosticsMessage';
import DiagnosticsCodeActions from './DiagnosticsCodeActions';
Expand Down Expand Up @@ -94,13 +95,25 @@ function getCodeActions(
}

// TODO move LESS styles to nuclide-ui
export const DiagnosticsPopup = (props: DiagnosticsPopupProps) => {
const {fixer, goToLocation, codeActionsForMessage, messages, ...rest} = props;
return (
<div className="diagnostics-popup" {...rest}>
{messages.map(
renderMessage.bind(null, fixer, goToLocation, codeActionsForMessage),
)}
</div>
);
};
export class DiagnosticsPopup extends React.Component<DiagnosticsPopupProps> {
componentDidMount() {
analytics.track('diagnostics-show-popup');
}

render() {
const {
fixer,
goToLocation,
codeActionsForMessage,
messages,
...rest
} = this.props;
return (
<div className="diagnostics-popup" {...rest}>
{messages.map(
renderMessage.bind(null, fixer, goToLocation, codeActionsForMessage),
)}
</div>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export class OutlineViewSearchComponent extends React.Component<Props, State> {
};
_onDidChange = debounce(query => {
analytics.track('outline-view:change-query');
this.setState({currentQuery: query});
}, this.DEBOUNCE_TIME);
Expand Down
2 changes: 1 addition & 1 deletion modules/eslint-plugin-nuclide-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-nuclide-internal",
"version": "0.5.0",
"version": "0.5.1-dev",
"description": "A custom ESLint plugin for Atom/Nuclide code",
"author": "NEEDS OWNER",
"license": "BSD-3-Clause",
Expand Down
10 changes: 10 additions & 0 deletions modules/nuclide-commons-atom/FeatureLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ export default class FeatureLoader {
);

this._features.forEach(feature => {
// Since the migration from bool to enum occurs before the config defaults
// are changed, the user's config gets filled with every Nuclide feature.
// Since these values are already the default, this `config.set`
// removes these uneccessary values from the user's config file.
// TODO: When enough users have migrated, this should be removed along with the enum migration.
atom.config.set(
this.useKeyPathForFeature(feature),
atom.config.get(this.useKeyPathForFeature(feature)),
);

if (this.shouldEnable(feature)) {
atom.packages.activatePackage(feature.path);
}
Expand Down
4 changes: 2 additions & 2 deletions modules/nuclide-commons-atom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclide-commons-atom",
"version": "0.5.0",
"version": "0.5.1-dev",
"description": "Common Nuclide node modules (for use with Atom only).",
"author": "NEEDS OWNER",
"license": "BSD-3-Clause",
Expand All @@ -16,7 +16,7 @@
"escape-string-regexp": "1.0.5",
"idx": "1.2.0",
"log4js": "1.1.1",
"nuclide-commons": "0.5.1",
"nuclide-commons": "0.5.1-dev",
"redux-logger": "3.0.6",
"rxjs": "5.5.5",
"semver": "5.3.0",
Expand Down
10 changes: 6 additions & 4 deletions modules/nuclide-commons-ui/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ export type Column<T: Object> = {
};

export type Row<T: Object> = {
+className?: string,
+data: T,
className?: string,
data: T,
rowAttributes?: Object,
};

type PercentageWidthMap<T> = {[key: $Keys<T>]: number};
Expand Down Expand Up @@ -550,7 +551,7 @@ export class Table<T: Object> extends React.Component<Props<T>, State<T>> {
})
);
let body = rows.map((row, i) => {
const {className: rowClassName, data} = row;
const {className: rowClassName, data, rowAttributes} = row;
const renderedRow = columns.map((column, j) => {
const {
key,
Expand All @@ -577,7 +578,8 @@ export class Table<T: Object> extends React.Component<Props<T>, State<T>> {
})}
key={j}
style={cellStyle}
title={typeof datum !== 'object' ? String(datum) : null}>
title={typeof datum !== 'object' ? String(datum) : null}
{...rowAttributes}>
{datum}
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions modules/nuclide-commons-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclide-commons-ui",
"version": "0.5.0",
"version": "0.5.1-dev",
"description": "Common Nuclide UI components.",
"author": "Nuclide: Core UI",
"license": "BSD-3-Clause",
Expand All @@ -19,8 +19,8 @@
"idx": "1.2.0",
"invariant": "2.2.2",
"lodash": "4.17.4",
"nuclide-commons": "0.5.1",
"nuclide-commons-atom": "0.5.0",
"nuclide-commons": "0.5.1-dev",
"nuclide-commons-atom": "0.5.1-dev",
"nullthrows": "1.0.0",
"react": "16.2.0",
"react-dom": "16.2.0",
Expand Down
Loading

0 comments on commit 4823e23

Please sign in to comment.