Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable intellisense on android #10246

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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