mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-17 09:47:06 +00:00
Format and fix type issues
This commit is contained in:
parent
35dbaeea96
commit
3bc2701356
@ -91,7 +91,7 @@ const makeMapStateToProps = (initialState: AppState, initialProps: IMonacoProps)
|
|||||||
ownProps.notebookLanguageOverride
|
ownProps.notebookLanguageOverride
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
return mapStateToProps;
|
return mapStateToProps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -91,9 +91,9 @@ class CompletionItemProvider implements monaco.languages.CompletionItemProvider
|
|||||||
const completion$ = channels.pipe(
|
const completion$ = channels.pipe(
|
||||||
childOf(message),
|
childOf(message),
|
||||||
ofMessageType("complete_reply"),
|
ofMessageType("complete_reply"),
|
||||||
map((entry) => entry.content),
|
map(entry => entry.content),
|
||||||
first(),
|
first(),
|
||||||
map((results) => this.adaptToMonacoCompletions(results, model))
|
map(results => this.adaptToMonacoCompletions(results, model))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Subscribe and send completion request message
|
// Subscribe and send completion request message
|
||||||
@ -112,7 +112,7 @@ class CompletionItemProvider implements monaco.languages.CompletionItemProvider
|
|||||||
let percentCount = 0;
|
let percentCount = 0;
|
||||||
let matches = results ? results.matches : [];
|
let matches = results ? results.matches : [];
|
||||||
if (results.metadata && results.metadata._jupyter_types_experimental) {
|
if (results.metadata && results.metadata._jupyter_types_experimental) {
|
||||||
matches = results.metadata._jupyter_types_experimental;
|
matches = results.metadata._jupyter_types_experimental as CompletionMatch[];
|
||||||
}
|
}
|
||||||
return matches.map((match: CompletionMatch, index: number) => {
|
return matches.map((match: CompletionMatch, index: number) => {
|
||||||
if (typeof match === "string") {
|
if (typeof match === "string") {
|
||||||
|
@ -59,10 +59,7 @@ export const completionRequest = (code: string, cursorPos: number) =>
|
|||||||
* @param js_idx JavaScript index
|
* @param js_idx JavaScript index
|
||||||
* @param text Text
|
* @param text Text
|
||||||
*/
|
*/
|
||||||
export const js_idx_to_char_idx: (js_idx: number, text: string) => number = (
|
export const js_idx_to_char_idx: (js_idx: number, text: string) => number = (js_idx: number, text: string): number => {
|
||||||
js_idx: number,
|
|
||||||
text: string
|
|
||||||
): number => {
|
|
||||||
let char_idx: number = js_idx;
|
let char_idx: number = js_idx;
|
||||||
for (let i = 0; i + 1 < text.length && i < js_idx; i++) {
|
for (let i = 0; i + 1 < text.length && i < js_idx; i++) {
|
||||||
const char_code: number = text.charCodeAt(i);
|
const char_code: number = text.charCodeAt(i);
|
||||||
|
@ -117,7 +117,12 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
|||||||
{{
|
{{
|
||||||
editor: {
|
editor: {
|
||||||
codemirror: (props: PassedEditorProps) => (
|
codemirror: (props: PassedEditorProps) => (
|
||||||
<MonacoEditor {...props} lineNumbers={true} enableCompletion={true} shouldRegisterDefaultCompletion={true} />
|
<MonacoEditor
|
||||||
|
{...props}
|
||||||
|
lineNumbers={true}
|
||||||
|
enableCompletion={true}
|
||||||
|
shouldRegisterDefaultCompletion={true}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
prompt: ({ id, contentRef }: { id: CellId; contentRef: ContentRef }) => (
|
prompt: ({ id, contentRef }: { id: CellId; contentRef: ContentRef }) => (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user