File tree Expand file tree Collapse file tree 4 files changed +37
-11
lines changed
Expand file tree Collapse file tree 4 files changed +37
-11
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ public void AddCompletion(CompleteContext context)
1212 {
1313 AddGlobalCompletion ( context ) ;
1414 }
15- else if ( context . TriggerToken is LuaWhitespaceToken )
16- {
17- AddGlobalCompletion ( context ) ;
18- }
19- else if ( context . TriggerToken is { Kind : LuaTokenKind . TkEndOfLine } )
20- {
21- AddGlobalCompletion ( context ) ;
22- }
15+ // else if (context.TriggerToken is LuaWhitespaceToken)
16+ // {
17+ // AddGlobalCompletion(context);
18+ // }
19+ // else if (context.TriggerToken is { Kind: LuaTokenKind.TkEndOfLine })
20+ // {
21+ // AddGlobalCompletion(context);
22+ // }
2323 }
2424
2525 private void AddGlobalCompletion ( CompleteContext context )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public class CompletionHandler(ServerContext context) : CompletionHandlerBase
1414
1515 private CompletionDocumentResolver DocumentResolver { get ; } = new ( ) ;
1616
17- protected override async Task < CompletionResponse ? > Handle ( CompletionParams request , CancellationToken token )
17+ protected override Task < CompletionResponse ? > Handle ( CompletionParams request , CancellationToken token )
1818 {
1919 var uri = request . TextDocument . Uri . UnescapeUri ;
2020 CompletionResponse ? response = null ;
@@ -30,7 +30,7 @@ public class CompletionHandler(ServerContext context) : CompletionHandlerBase
3030 }
3131 } ) ;
3232
33- return await Task . FromResult ( response ) ! ;
33+ return Task . FromResult ( response ) ! ;
3434 }
3535
3636 protected override Task < CompletionItem > Resolve ( CompletionItem item , CancellationToken token )
Original file line number Diff line number Diff line change 1919using EmmyLua . LanguageServer . Rename ;
2020using EmmyLua . LanguageServer . SemanticToken ;
2121using EmmyLua . LanguageServer . Server ;
22+ using EmmyLua . LanguageServer . Server . Scheduler ;
2223using EmmyLua . LanguageServer . SignatureHelper ;
2324using EmmyLua . LanguageServer . TextDocument ;
2425using EmmyLua . LanguageServer . TypeHierarchy ;
4950
5051InitializeParams initializeParams = null ! ;
5152var ls = LanguageServer . From ( input , output ) ;
52- ls . SetScheduler ( new SimpleMultiThreadScheduler ( ) ) ;
53+ var scheduler = new EmmyScheduler ( ) ;
54+ ls . SetScheduler ( scheduler ) ;
5355ls . AddJsonSerializeContext ( EmmyLuaJsonGenerateContext . Default ) ;
5456var serverContext = new ServerContext ( ls ) ;
5557ls . OnInitialize ( ( c , s ) =>
Original file line number Diff line number Diff line change 1+ using EmmyLua . LanguageServer . Framework . Protocol . JsonRpc ;
2+ using EmmyLua . LanguageServer . Framework . Server . Scheduler ;
3+
4+ namespace EmmyLua . LanguageServer . Server . Scheduler ;
5+
6+ public class EmmyScheduler : IScheduler
7+ {
8+ public void Schedule ( Func < Message , Task > action , Message message )
9+ {
10+ if ( message is NotificationMessage requestMessage )
11+ {
12+ switch ( requestMessage . Method )
13+ {
14+ case "textDocument/didChange" :
15+ {
16+ action ( message ) . Wait ( ) ;
17+ return ;
18+ }
19+ }
20+ }
21+
22+ Task . Run ( ( ) => action ( message ) ) ;
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments