Skip to content

Added flag to disable real-time PublishDiagnostics push #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ls/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Config struct {
FormatterConf *paths.Path
EnableLogging bool
SkipLibrariesDiscoveryOnRebuild bool
DisableRealTimeDiagnostics bool
}

var yellow = color.New(color.FgHiYellow)
Expand Down Expand Up @@ -1191,6 +1192,11 @@ func (ls *INOLanguageServer) CopyFullBuildResults(logger jsonrpc.FunctionLogger,
}

func (ls *INOLanguageServer) PublishDiagnosticsNotifFromClangd(logger jsonrpc.FunctionLogger, clangParams *lsp.PublishDiagnosticsParams) {
if ls.config.DisableRealTimeDiagnostics {
logger.Logf("Ignored by configuration")
return
}

ls.readLock(logger, false)
defer ls.readUnlock(logger)

Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func main() {
skipLibrariesDiscoveryOnRebuild := flag.Bool(
"skip-libraries-discovery-on-rebuild", false,
"Skip libraries discovery on rebuild, it will make rebuilds faster but it will fail if the used libraries changes.")
noRealTimeDiagnostics := flag.Bool(
"no-real-time-diagnostics", false,
"Disable real time diagnostics")
flag.Parse()

if *loggingBasePath != "" {
Expand Down Expand Up @@ -123,6 +126,7 @@ func main() {
CliDaemonAddress: *cliDaemonAddress,
CliInstanceNumber: *cliDaemonInstanceNumber,
SkipLibrariesDiscoveryOnRebuild: *skipLibrariesDiscoveryOnRebuild,
DisableRealTimeDiagnostics: *noRealTimeDiagnostics,
}

stdio := streams.NewReadWriteCloser(os.Stdin, os.Stdout)
Expand Down