Added lsp service methods; fixed margin width line; cleanup

This commit is contained in:
itdominator 2025-06-27 23:52:41 -05:00
parent d7c8ea1902
commit d1dbb7efcc
5 changed files with 20 additions and 7 deletions

View File

@ -12,7 +12,7 @@ const SETTINGS_CONFIG_PATH = path.join(CONFIG_PATH, "/settings.json");
const LSP_CONFIG_PATH = path.join(BASE_PATH, "/resources/lsp-servers-config.json");
let window = null;
let watcher = null;
let skipOnceFileWatchChange = false;
let skipOnceFileWatchChange = false;

View File

@ -90,10 +90,8 @@ export class FilesService {
data = await window.fs.getFileContents(file.path);
file.session = new EditSession(data);
file.session.setMode(
getModeForPath( file.path ).mode
);
file.session.setUndoManager( new UndoManager() );
file.session.setMode( getModeForPath( file.path ).mode );
this.files.set(file.path, file);
} catch (error) {

View File

@ -74,4 +74,15 @@ export class LSPService {
let worker = new Worker(new URL('./webworker.js', import.meta.url));
return LanguageProvider.create(worker);
}
protected setSessionFilePath(session: any, mode: string = "", filePath: string = "") => {
if ( !session || !mode || !filePath || !this.languageProviders[mode] ) return;
this.languageProviders[mode].setSessionFilePath(session, filePath);
}
protected closeDocument(session: any, mode: string) => {
if ( !session || !mode || !this.languageProviders[mode] ) return;
this.languageProviders[mode].closeDocument(session);
}
}

View File

@ -46,13 +46,16 @@ export class NewtonEditorComponent extends NewtonEditorBase {
}
private loadAce(): void {
this.configAceAndBindToElement()
this.loadAceKeyBindings();
this.loadAceEventBindings();
}
private configAceAndBindToElement(): void {
ace.config.set('basePath', this.editorSettings.BASE_PATH);
this.editor = ace.edit( this.editorElm.nativeElement );
this.editor.setOptions( this.editorSettings.CONFIG );
this.loadAceKeyBindings();
this.loadAceEventBindings();
}
private loadAceKeyBindings(): void {

View File

@ -39,6 +39,7 @@
}
.ace_print-margin {
width: 1px !important;
background-color: rgba(255, 0, 0, 0.84) !important;
}