-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: WIP compile on didChangedWatchedFilesNotification
- Loading branch information
Showing
19 changed files
with
102 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version = 4.1.3-alpha | ||
version = 4.2.0-alpha | ||
gradleVersion = 7.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 36 additions & 2 deletions
38
src/main/java/ch/fhnw/thga/fregelanguageserver/lsp/FregeWorkspaceService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,50 @@ | ||
package ch.fhnw.thga.fregelanguageserver.lsp; | ||
|
||
import java.net.URI; | ||
|
||
import org.eclipse.lsp4j.DidChangeConfigurationParams; | ||
import org.eclipse.lsp4j.DidChangeWatchedFilesParams; | ||
import org.eclipse.lsp4j.services.WorkspaceService; | ||
|
||
class FregeWorkspaceService implements WorkspaceService { | ||
import ch.fhnw.thga.fregelanguageserver.compile.CompileService; | ||
import ch.fhnw.thga.fregelanguageserver.diagnostic.DiagnosticService; | ||
|
||
class FregeWorkspaceService implements WorkspaceService | ||
{ | ||
private final FregeLanguageServer fregeServer; | ||
private final CompileService compileService; | ||
|
||
public FregeWorkspaceService(FregeLanguageServer fregeServer, CompileService compileService) | ||
{ | ||
this.fregeServer = fregeServer; | ||
this.compileService = compileService; | ||
} | ||
|
||
@Override | ||
public void didChangeConfiguration(DidChangeConfigurationParams params) { | ||
} | ||
|
||
@Override | ||
public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) { | ||
public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) | ||
{ | ||
// TODO: extract function to functional consumer, give it good name and call it in forEach | ||
params.getChanges().forEach | ||
( | ||
change -> | ||
{ | ||
URI uri = URI.create(change.getUri()); | ||
compileService.compileAndUpdateGlobals | ||
( | ||
uri, | ||
fregeServer.getProjectService().getProjectGlobal() | ||
); | ||
DiagnosticService.publishCompilerDiagnostics | ||
( | ||
fregeServer.getClient(), | ||
compileService.getGlobal(uri), | ||
uri.toString() | ||
); | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters