Skip to content
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

Includes command line option to disable diagnostics #163

Merged
merged 1 commit into from
Oct 1, 2020
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
7 changes: 6 additions & 1 deletion fortls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def main():
'--max_comment_line_length', type=int, default=-1,
help="Maximum comment line length (default: disabled)"
)
parser.add_argument(
'--disable_diagnostics', action="store_true",
help="Disable diagnostics"
)
parser.add_argument(
'--debug_log', action="store_true",
help="Generate debug log in project root folder"
Expand Down Expand Up @@ -188,7 +192,8 @@ def main():
"sort_keywords": (not args.preserve_keyword_order),
"enable_code_actions": (args.enable_code_actions or args.debug_actions),
"max_line_length": args.max_line_length,
"max_comment_line_length": args.max_comment_line_length
"max_comment_line_length": args.max_comment_line_length,
"disable_diagnostics": args.disable_diagnostics,
}
if args.hover_language is not None:
settings["hover_language"] = args.hover_language
Expand Down
4 changes: 3 additions & 1 deletion fortls/langserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def __init__(self, conn, debug_log=False, settings={}):
self.hover_language = settings.get("hover_language", "fortran90")
self.sort_keywords = settings.get("sort_keywords", True)
self.enable_code_actions = settings.get("enable_code_actions", False)
self.disable_diagnostics = settings.get("disable_diagnostics", False)
self.max_line_length = settings.get("max_line_length", -1)
self.max_comment_line_length = settings.get("max_comment_line_length", -1)
# Set object settings
Expand Down Expand Up @@ -1234,7 +1235,8 @@ def serve_onSave(self, request, did_open=False, did_close=False):
self.link_version = (self.link_version + 1) % 1000
for _, file_obj in self.workspace.items():
file_obj.ast.resolve_links(self.obj_tree, self.link_version)
self.send_diagnostics(uri)
if not self.disable_diagnostics:
self.send_diagnostics(uri)

def update_workspace_file(self, filepath, read_file=False, allow_empty=False, update_links=False):
# Update workspace from file contents and path
Expand Down