This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
feat: add diagnostic support for vhdl with vcom and ghdl #1207
Open
medwatt
wants to merge
1
commit into
jose-elias-alvarez:main
Choose a base branch
from
medwatt:vhdl_diagnostic_sources
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
local h = require("null-ls.helpers") | ||
local methods = require("null-ls.methods") | ||
|
||
local DIAGNOSTICS = methods.internal.DIAGNOSTICS | ||
|
||
return h.make_builtin({ | ||
name = "ghdl", | ||
meta = { | ||
url = "https://github.com/ghdl/ghdl", | ||
description = "Adds support for `ghdl` VHDL compiler/checker", | ||
}, | ||
method = DIAGNOSTICS, | ||
filetypes = { "vhdl" }, | ||
generator_opts = { | ||
command = "ghdl", | ||
to_stdin = false, | ||
to_temp_file = true, | ||
from_stderr = true, | ||
args = { "-a", "--std=08", "--workdir=/tmp", "$FILENAME" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, just so I understand: is the |
||
format = "line", | ||
on_output = h.diagnostics.from_pattern( | ||
[[([^:]+):(%d+):(%d+):%s+(.+)]], | ||
{ 'filename', 'row', 'col', 'message'}, | ||
{ | ||
severities = { | ||
E = h.diagnostics.severities["error"], | ||
}, | ||
} | ||
), | ||
}, | ||
factory = h.generator_factory, | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
local h = require("null-ls.helpers") | ||
local methods = require("null-ls.methods") | ||
|
||
local DIAGNOSTICS = methods.internal.DIAGNOSTICS | ||
|
||
return h.make_builtin({ | ||
name = "vcom", | ||
meta = { | ||
url = "https://eda.sw.siemens.com/en-US/ic/modelsim/", | ||
description = "Adds support for Mentor Graphics Questa/ModelSim `vcom` VHDL compiler/checker", | ||
notes = "If you want the work directory to be in the current working directory, remove '-work' and '/tmp/vcom_work' from the args list", | ||
}, | ||
method = DIAGNOSTICS, | ||
filetypes = { "vhdl" }, | ||
generator_opts = { | ||
command = "vcom", | ||
args = { "-2008", "-quiet", "-lint", "-work", "/tmp/vcom_work", "$FILENAME" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments for above apply here. |
||
to_stdin = false, | ||
to_temp_file = true, | ||
from_stderr = true, | ||
format = "line", | ||
on_output = h.diagnostics.from_pattern( | ||
[[^**%s(%w+):[%a%d%s%.-_/]+%((%d+)%):%s+(.+)]], | ||
{"severity", "row", "message" }, | ||
{ | ||
severities = { | ||
E = h.diagnostics.severities["Error"], | ||
W = h.diagnostics.severities["Warning"], | ||
}, | ||
} | ||
), | ||
}, | ||
factory = h.generator_factory, | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know nothing about this language or CLI tool, but judging from the documentation, it looks like there are multiple standards. Is this something we want to always set, or should we leave it up to users to configure?