@@ -3,7 +3,7 @@ import * as ls from './languageclient';
3
3
import * as rpc from 'vscode-jsonrpc' ;
4
4
import * as path from 'path' ;
5
5
import * as atomIde from 'atom-ide' ;
6
- import type { OutlineProvider , Outline , DefinitionProvider , DefinitionQueryResult , FindReferencesProvider , FindReferencesReturn , Datatip , DatatipService } from 'atom-ide-base' ;
6
+ import type { OutlineProvider , Outline , DefinitionProvider , DefinitionQueryResult , FindReferencesProvider , FindReferencesReturn , Datatip , DatatipService , TextEdit , RangeCodeFormatProvider , FileCodeFormatProvider , OnSaveCodeFormatProvider , OnTypeCodeFormatProvider } from 'atom-ide-base' ;
7
7
import * as linter from 'atom/linter' ;
8
8
import Convert from './convert.js' ;
9
9
import ApplyEditAdapter from './adapters/apply-edit-adapter' ;
@@ -42,7 +42,7 @@ import {
42
42
TextEditor ,
43
43
} from 'atom' ;
44
44
import * as ac from 'atom/autocomplete-plus' ;
45
- import { TextEdit , CodeAction } from 'atom-ide' ;
45
+ import { CodeAction } from 'atom-ide' ;
46
46
47
47
export { ActiveServer , LanguageClientConnection , LanguageServerProcess } ;
48
48
export type ConnectionType = 'stdio' | 'socket' | 'ipc' ;
@@ -634,15 +634,15 @@ export default class AutoLanguageClient {
634
634
}
635
635
636
636
// Code Format via LS formatDocument & formatDocumentRange------------
637
- public provideCodeFormat ( ) : atomIde . RangeCodeFormatProvider {
637
+ public provideCodeFormat ( ) : RangeCodeFormatProvider {
638
638
return {
639
639
grammarScopes : this . getGrammarScopes ( ) ,
640
640
priority : 1 ,
641
641
formatCode : this . getCodeFormat . bind ( this ) ,
642
642
} ;
643
643
}
644
644
645
- protected async getCodeFormat ( editor : TextEditor , range : Range ) : Promise < atomIde . TextEdit [ ] > {
645
+ protected async getCodeFormat ( editor : TextEditor , range : Range ) : Promise < TextEdit [ ] > {
646
646
const server = await this . _serverManager . getServer ( editor ) ;
647
647
if ( server == null || ! CodeFormatAdapter . canAdapt ( server . capabilities ) ) {
648
648
return [ ] ;
@@ -651,15 +651,15 @@ export default class AutoLanguageClient {
651
651
return CodeFormatAdapter . format ( server . connection , server . capabilities , editor , range ) ;
652
652
}
653
653
654
- public provideRangeCodeFormat ( ) : atomIde . RangeCodeFormatProvider {
654
+ public provideRangeCodeFormat ( ) : RangeCodeFormatProvider {
655
655
return {
656
656
grammarScopes : this . getGrammarScopes ( ) ,
657
657
priority : 1 ,
658
658
formatCode : this . getRangeCodeFormat . bind ( this ) ,
659
659
} ;
660
660
}
661
661
662
- protected async getRangeCodeFormat ( editor : TextEditor , range : Range ) : Promise < atomIde . TextEdit [ ] > {
662
+ protected async getRangeCodeFormat ( editor : TextEditor , range : Range ) : Promise < TextEdit [ ] > {
663
663
const server = await this . _serverManager . getServer ( editor ) ;
664
664
if ( server == null || ! server . capabilities . documentRangeFormattingProvider ) {
665
665
return [ ] ;
@@ -668,23 +668,23 @@ export default class AutoLanguageClient {
668
668
return CodeFormatAdapter . formatRange ( server . connection , editor , range ) ;
669
669
}
670
670
671
- public provideFileCodeFormat ( ) : atomIde . FileCodeFormatProvider {
671
+ public provideFileCodeFormat ( ) : FileCodeFormatProvider {
672
672
return {
673
673
grammarScopes : this . getGrammarScopes ( ) ,
674
674
priority : 1 ,
675
675
formatEntireFile : this . getFileCodeFormat . bind ( this ) ,
676
676
} ;
677
677
}
678
678
679
- public provideOnSaveCodeFormat ( ) : atomIde . OnSaveCodeFormatProvider {
679
+ public provideOnSaveCodeFormat ( ) : OnSaveCodeFormatProvider {
680
680
return {
681
681
grammarScopes : this . getGrammarScopes ( ) ,
682
682
priority : 1 ,
683
683
formatOnSave : this . getFileCodeFormat . bind ( this ) ,
684
684
} ;
685
685
}
686
686
687
- protected async getFileCodeFormat ( editor : TextEditor ) : Promise < atomIde . TextEdit [ ] > {
687
+ protected async getFileCodeFormat ( editor : TextEditor ) : Promise < TextEdit [ ] > {
688
688
const server = await this . _serverManager . getServer ( editor ) ;
689
689
if ( server == null || ! server . capabilities . documentFormattingProvider ) {
690
690
return [ ] ;
@@ -693,7 +693,7 @@ export default class AutoLanguageClient {
693
693
return CodeFormatAdapter . formatDocument ( server . connection , editor ) ;
694
694
}
695
695
696
- public provideOnTypeCodeFormat ( ) : atomIde . OnTypeCodeFormatProvider {
696
+ public provideOnTypeCodeFormat ( ) : OnTypeCodeFormatProvider {
697
697
return {
698
698
grammarScopes : this . getGrammarScopes ( ) ,
699
699
priority : 1 ,
@@ -705,7 +705,7 @@ export default class AutoLanguageClient {
705
705
editor : TextEditor ,
706
706
point : Point ,
707
707
character : string ,
708
- ) : Promise < atomIde . TextEdit [ ] > {
708
+ ) : Promise < TextEdit [ ] > {
709
709
const server = await this . _serverManager . getServer ( editor ) ;
710
710
if ( server == null || ! server . capabilities . documentOnTypeFormattingProvider ) {
711
711
return [ ] ;
0 commit comments