diff --git a/newton/fs.js b/newton/fs.js index ab4b043..e1f879d 100644 --- a/newton/fs.js +++ b/newton/fs.js @@ -114,7 +114,6 @@ const chooseFolder = () => { console.debug("Canceled folder selection..."); return ""; } - console.log(response) return response.filePaths[0]; }); diff --git a/package.json b/package.json index f978862..2d06c64 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "ace-builds": "1.43.0", "ace-diff": "3.0.3", "ace-layout": "1.5.0", - "ace-linters": "1.7.1", + "ace-linters": "1.8.1", "bootstrap": "5.3.6", "bootstrap-icons": "1.12.1", "chokidar": "4.0.3", @@ -106,4 +106,4 @@ "tslib": "2.3.0", "typescript": "5.7.2" } -} \ No newline at end of file +} diff --git a/public/lsp-servers-config.json b/public/lsp-servers-config.json index 7b2df8e..727fc4e 100644 --- a/public/lsp-servers-config.json +++ b/public/lsp-servers-config.json @@ -24,6 +24,7 @@ }, "settings": { "java": { + "home": "/usr/lib/jvm/java-17-openjdk", "autobuild": { "enabled": false }, @@ -44,8 +45,8 @@ }, "runtimes": [ { - "name": "JavaSE-17", - "path": "/usr/lib/jvm/default-runtime", + "name": "JavaJDK-17", + "path": "/usr/lib/jvm/java-17-openjdk", "javadoc": "https://docs.oracle.com/en/java/javase/17/docs/api/", "default": true } @@ -59,7 +60,6 @@ "{user.home}/.config/jdtls/m2/repository/**/*-javadoc.jar", "lib/**/*-javadoc.jar" ], - "silentNotification": true, "project": { "encoding": "ignore", "outputPath": "bin", @@ -133,6 +133,7 @@ "downloadSources": true, "updateSnapshots": true }, + "silentNotification": false, "signatureHelp": { "enabled": true, "description": { @@ -141,6 +142,15 @@ }, "implementationsCodeLens": { "enabled": true + }, + "referencesCodeLens": { + "enabled": true + }, + "progressReports": { + "enabled": false + }, + "saveActions": { + "organizeImports": true } } } diff --git a/src/app/common/constants/button.map.ts b/src/app/common/constants/button.map.ts new file mode 100644 index 0000000..f490bd8 --- /dev/null +++ b/src/app/common/constants/button.map.ts @@ -0,0 +1,5 @@ +export abstract class ButtonMap { + static LEFT: number = 0; + static MIDDLE: number = 1; + static RIGHT: number = 2; +} \ No newline at end of file diff --git a/src/app/common/services/editor/lsp-manager/lsp-manager.service.ts b/src/app/common/services/editor/lsp-manager/lsp-manager.service.ts index ec962c1..69d5730 100644 --- a/src/app/common/services/editor/lsp-manager/lsp-manager.service.ts +++ b/src/app/common/services/editor/lsp-manager/lsp-manager.service.ts @@ -35,10 +35,7 @@ export class LspManagerService { this.languageProviders[mode]?.registerEditor( editor, - { - filePath: editor.session["id"], - joinWorkspaceURI: true - } + editor.session.lspConfig ); } @@ -97,8 +94,13 @@ export class LspManagerService { return; } - this.languageProviders[mode] = AceLanguageClient.for(servers); - // this.languageProviders[mode].requireFilePath = true; + this.languageProviders[mode] = AceLanguageClient.for( + servers, + { + manualSessionControl: true + } + ); + this.languageProviders[mode].changeWorkspaceFolder(this.workspaceFolder); return this.languageProviders[mode]; } @@ -108,11 +110,15 @@ export class LspManagerService { return LanguageProvider.create(worker); } - public setSessionFilePath(session: any, filePath: string = "") { - if ( !session || !filePath ) return; - let mode = this.getMode(session); + public registerSession(editor: any) { + let mode = this.getMode(editor.session); if ( !this.languageProviders[mode] ) return; - this.languageProviders[mode].setSessionFilePath(session, filePath); + + this.languageProviders[mode].registerSession( + editor.session, + editor, + editor.session.lspConfig + ); } public getMode(session: any): string { diff --git a/src/app/common/services/files.service.ts b/src/app/common/services/files.service.ts index 0ab0071..51dc13b 100644 --- a/src/app/common/services/files.service.ts +++ b/src/app/common/services/files.service.ts @@ -111,6 +111,10 @@ export class FilesService { file.session["id"] = path; file.session.setUndoManager( new UndoManager() ); file.session.setMode( getModeForPath( file.path ).mode ); + file.session["lspConfig"] = { + filePath: path, + joinWorkspaceURI: false + } this.files.set(file.path, file); } catch (error) { diff --git a/src/app/editor/code-view/view.base.ts b/src/app/editor/code-view/view.base.ts index 4b41fc6..3ff14bf 100644 --- a/src/app/editor/code-view/view.base.ts +++ b/src/app/editor/code-view/view.base.ts @@ -46,6 +46,9 @@ export class CodeViewBase { public debounceId: number = -1; public debounceWait: number = 800; + @ViewChild('contextMenu') contextMenu!: ElementRef; + public showContextMenu: boolean = false; + constructor() { } diff --git a/src/app/editor/code-view/view.component.css b/src/app/editor/code-view/view.component.css index 4349a02..daa9d03 100644 --- a/src/app/editor/code-view/view.component.css +++ b/src/app/editor/code-view/view.component.css @@ -25,4 +25,24 @@ border-style: solid; border-width: thin; border-color: rgba(124, 124, 124, 1); -} \ No newline at end of file +} + + +.contextMenu { + display: inline-table; + z-index: 500; + position: absolute; + min-width: 2em; + padding: 0.2em; + top: 0em; + right: 0em; +} + +.contextMenu li:hover { + background-color: rgba(0, 124, 0, 0.64); + cursor: pointer; +} + +.contextMenu li { + padding: 0em 0.2em; +} diff --git a/src/app/editor/code-view/view.component.html b/src/app/editor/code-view/view.component.html index a086340..563bcb4 100644 --- a/src/app/editor/code-view/view.component.html +++ b/src/app/editor/code-view/view.component.html @@ -1,2 +1,15 @@