Added lsp service methods; fixed margin width line; cleanup
This commit is contained in:
parent
d7c8ea1902
commit
d1dbb7efcc
@ -90,10 +90,8 @@ export class FilesService {
|
|||||||
data = await window.fs.getFileContents(file.path);
|
data = await window.fs.getFileContents(file.path);
|
||||||
|
|
||||||
file.session = new EditSession(data);
|
file.session = new EditSession(data);
|
||||||
file.session.setMode(
|
|
||||||
getModeForPath( file.path ).mode
|
|
||||||
);
|
|
||||||
file.session.setUndoManager( new UndoManager() );
|
file.session.setUndoManager( new UndoManager() );
|
||||||
|
file.session.setMode( getModeForPath( file.path ).mode );
|
||||||
|
|
||||||
this.files.set(file.path, file);
|
this.files.set(file.path, file);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -74,4 +74,15 @@ export class LSPService {
|
|||||||
let worker = new Worker(new URL('./webworker.js', import.meta.url));
|
let worker = new Worker(new URL('./webworker.js', import.meta.url));
|
||||||
return LanguageProvider.create(worker);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -46,13 +46,16 @@ export class NewtonEditorComponent extends NewtonEditorBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private loadAce(): void {
|
private loadAce(): void {
|
||||||
|
this.configAceAndBindToElement()
|
||||||
|
this.loadAceKeyBindings();
|
||||||
|
this.loadAceEventBindings();
|
||||||
|
}
|
||||||
|
|
||||||
|
private configAceAndBindToElement(): void {
|
||||||
ace.config.set('basePath', this.editorSettings.BASE_PATH);
|
ace.config.set('basePath', this.editorSettings.BASE_PATH);
|
||||||
|
|
||||||
this.editor = ace.edit( this.editorElm.nativeElement );
|
this.editor = ace.edit( this.editorElm.nativeElement );
|
||||||
this.editor.setOptions( this.editorSettings.CONFIG );
|
this.editor.setOptions( this.editorSettings.CONFIG );
|
||||||
|
|
||||||
this.loadAceKeyBindings();
|
|
||||||
this.loadAceEventBindings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadAceKeyBindings(): void {
|
private loadAceKeyBindings(): void {
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ace_print-margin {
|
.ace_print-margin {
|
||||||
|
width: 1px !important;
|
||||||
background-color: rgba(255, 0, 0, 0.84) !important;
|
background-color: rgba(255, 0, 0, 0.84) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user