Skip to content

Commit

Permalink
Re-enable intellisense on android
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Oct 25, 2024
1 parent 712a05f commit cc62e91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 7 additions & 9 deletions pxteditor/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function setupMonaco() {
export function createEditor(element: HTMLElement): monaco.editor.IStandaloneCodeEditor {
const inverted = pxt.appTarget.appTheme.invertedMonaco;
const hasFieldEditors = !!(pxt.appTarget.appTheme.monacoFieldEditors && pxt.appTarget.appTheme.monacoFieldEditors.length);
const isAndroid = pxt.BrowserUtils.isAndroid();

let editor = monaco.editor.create(element, {
model: null,
Expand All @@ -120,15 +119,14 @@ export function createEditor(element: HTMLElement): monaco.editor.IStandaloneCod
theme: inverted ? 'vs-dark' : 'vs',
renderIndentGuides: true,
accessibilityHelpUrl: "", //TODO: Add help url explaining how to use the editor with a screen reader
// disable completions on android
quickSuggestions: {
"other": !isAndroid,
"comments": !isAndroid,
"strings": !isAndroid
"other": true,
"comments": true,
"strings": true
},
acceptSuggestionOnCommitCharacter: !isAndroid,
acceptSuggestionOnEnter: !isAndroid ? "on" : "off",
accessibilitySupport: !isAndroid ? "on" : "off"
acceptSuggestionOnCommitCharacter: true,
acceptSuggestionOnEnter: "on",
accessibilitySupport: "on"
});

editor.layout();
Expand Down Expand Up @@ -262,4 +260,4 @@ function initTypeScriptLanguageDefinition() {
noLib: true,
mouseWheelZoom: false
});
}
}
3 changes: 1 addition & 2 deletions webapp/src/monaco.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,9 @@ export class Editor extends toolboxeditor.ToolboxEditor {

display(): JSX.Element {
const showErrorList = pxt.appTarget.appTheme.errorList;
const isAndroid = pxt.BrowserUtils.isAndroid();

return (
<div id="monacoEditorArea" className={`monacoEditorArea ${isAndroid ? "android" : ""}`} style={{ direction: 'ltr' }}>
<div id="monacoEditorArea" className={`monacoEditorArea`} style={{ direction: 'ltr' }}>
{this.isVisible && <div className={`monacoToolboxDiv ${(this.toolbox && !this.toolbox.state.visible && !this.isDebugging()) ? 'invisible' : ''}`}>
<toolbox.Toolbox ref={this.handleToolboxRef} editorname="monaco" parent={this} />
<div id="monacoDebuggerToolbox"></div>
Expand Down

0 comments on commit cc62e91

Please sign in to comment.