Added lsp service methods; fixed margin width line; cleanup
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user