Commit graph

1187 commits

Author SHA1 Message Date
Olof Kraigher
61617ad210 Canonicalize get_source argument 2023-11-12 08:45:21 +01:00
Olof Kraigher
fdd01d5c67 Release 0.74.0 2023-11-11 20:47:23 +01:00
Olof Kraigher
9105fee658 Find references of user defined attribute 2023-11-11 19:32:45 +01:00
Olof Kraigher
4932d11218 Handle attribute of aliased entites 2023-11-11 19:11:39 +01:00
Olof Kraigher
07adcff48c Check duplicate attribute specification 2023-11-11 19:02:44 +01:00
Olof Kraigher
a1ec2b749b Check entity class of attribute specifications 2023-11-11 18:39:14 +01:00
Olof Kraigher
170d9aae70 Add user defined attributes 2023-11-11 17:49:14 +01:00
Olof Kraigher
99fdb409f8 Check attribute must be defined in immediate declarative part 2023-11-11 16:32:08 +01:00
Sebastian Kaupper
f563adb19e
Associate AST elements with tokens (#211)
* Implement get_token_id using a Token as parameter and rename the old implementation

* Add the trait TokenSpan which will annotate AST elements with a span of tokens

The macros `with_token_span` and `TokenSpan` of the newly added crate
`vhdl_lang_macros` automatically implement this trait for structs with
named fields.

* Apply the `with_token_span` and `TokenSpan` macros to some AST elements

Namely: TypeDeclaration, ObjectDeclaration, ProcedureSpecification,
FunctionSpecification, SubprogramInstantiation, SubprogramDeclaration,
LibraryClause, UseClause, ContextReference and ContextItem

* Introduce a new AST element SubprogramSpecification, and remove Option<>
from the TokenSpan trait

A SubprogramSpecification is the sole field of SubprogramDeclarations
but with a different meaning and a different token span.

* Apply the TokenSpan macros to further AST elements

The affected elements include:
- Declaration (and all its subelements)
- AnyPrimaryUnit (and all its subelements)
- AnySecondaryUnit (and all its subelements)
- AnyDesignUnit

Small changes to the parsing of file declarations were done for easier
handling and to better represent the official VHDL grammar

* Update version of vhdl_lang_macros crate

* Remove unused function get_token_id

* Rename TokenSpan related fields and structs and introduce helper
functions for unit tests

For consistency reasons rename the trait TokenSpan to HasTokenSpan and
the struct TokenInfo to TokenSpan.
Furthermore, rename the info field to span.

* Remove TokenSpan from subprogram specifications

* Change tests regarding file declarations to test if the parser recovers
successfully when encountering errors

* Introduce helper functions to cut down the size of some subprogram unit
tests

* Rename FoundDeclaration::SubprogramSpec and remove visitor functions for subprogram specifications
2023-11-10 19:33:58 +01:00
Olof Kraigher
27134eb013 Release 0.73.0 2023-11-08 22:20:25 +01:00
Olof Kraigher
40aea56356 Better error message on internal error for an array without any index 2023-11-08 20:22:58 +01:00
Olof Kraigher
c715b9f5ae Fix missing evaluation in case generate statement choice and expression 2023-11-08 20:12:42 +01:00
Olof Kraigher
6bc3a2131b Check for duplicate association of formal arguments 2023-11-08 19:52:02 +01:00
Olof Kraigher
b617851480 Check that positional arguments must come before named arguments 2023-11-08 19:52:02 +01:00
Schottkyc137
7d9c2f5b1c
Simplify the completion generics and port extraction method (#216)
* Simplify the completion generics and port extraction method

* Remove debug print statement in test code

* Also extract the ports or generics for an uninstantiated package
2023-11-08 18:54:59 +01:00
Schottkyc137
abdd6b1b43
Fix visitor is slow for large designs (#215)
* Fix: Only walk the units inside a source file with the visitor

* Fix: Only walk the units inside a source file with the visitor

* Remove unused source variable
2023-11-08 17:18:12 +01:00
Olof Kraigher
ccddd9e1f2 Release 0.72.0 2023-11-07 18:03:24 +01:00
Olof Kraigher
6b83b33fad Temporarily disable instantiation completions #212 2023-11-07 17:51:50 +01:00
Olof Kraigher
572b0110d6 Release 0.71.0 2023-11-06 21:27:27 +01:00
Olof Kraigher
b5aef2479c Support slicing of formal inside formal conversion 2023-11-06 21:23:00 +01:00
Olof Kraigher
f046969af8 Fix process sequential part labels added to wrong scope 2023-11-06 20:24:42 +01:00
Olof Kraigher
8bfc5668f9 Add universal real vs integer * and / 2023-11-06 20:16:33 +01:00
Olof Kraigher
154be37fc3 Release 0.70.0 2023-11-06 17:43:05 +01:00
Olof Kraigher
af9532cdc4 Improve unused declaration message 2023-11-06 17:42:04 +01:00
Olof Kraigher
1131197b1f Release 0.69.0 2023-11-05 19:32:31 +01:00
Olof Kraigher
96c1dcf20d Disable unused declaration detection in vhdl_lang main for now 2023-11-05 19:18:46 +01:00
Olof Kraigher
810af61d43 Add is_third_party library config 2023-11-05 19:12:53 +01:00
Olof Kraigher
0062004010 Add detection of unused local declarations 2023-11-05 18:40:52 +01:00
Olof Kraigher
5cd2cfe80a Analyze returns list of analyzed units 2023-11-05 18:40:52 +01:00
Olof Kraigher
2e9d2df6ce Clear declarations before re-analyzing 2023-11-05 18:40:52 +01:00
Olof Kraigher
42fe761f57 Clear references at the same time as resetting analysis 2023-11-05 16:38:15 +01:00
Olof Kraigher
9ae983a270 Release v0.68.0 2023-11-05 14:13:47 +01:00
Olof Kraigher
1d30ff3633 Ensure end_ident_pos is handled consistently when searching 2023-11-05 12:30:10 +01:00
Olof Kraigher
c34cd05917 Ensure protected type body map to non-body in signatures 2023-11-05 09:33:26 +01:00
Olof Kraigher
a24ea32272 Update OSVVM 2023-11-05 09:17:48 +01:00
Olof Kraigher
0f29e721ba Update vunit 2023-11-05 09:17:48 +01:00
Olof Kraigher
4d5b468d9f Version 0.67.0 2023-11-04 13:05:38 +01:00
Olof Kraigher
287f72e615 Use workspace resolver 2 2023-11-04 13:03:05 +01:00
Schottkyc137
b1faecac32
Parse Subprogram Instantiation Statement (#208)
* Add subprogram instantiation statement in AST

* Parse function instantiation statement

* Parse subprogram instantiation to declaration

* Add visitor

* Fix logic for identifier

* Add tests; refactoring

* Shorten path

* Fix tests
2023-11-04 09:19:06 +01:00
Schottkyc137
c84e06b410
More elaborate completions (#205)
* Implement more complex completion item

* Add more completion kinds

* Add support for snippets

* clippy

* remove non rendered text

* Add primitive overload resolution

* clippy

* improve overloaded format

* Re-add detail to standard completion item

* Make label and insertion text different

* fmt

* fix tests

* Remove items method and make local arena private again

* Refactor completion

* Add 'all' case

* Implement changes in server

* remove obsolete change

* Refactor to AnyEnt instead of ID

* Remove obsolete get_end function

* Fix unpredictable text order

* Fix: All should use the Completion item kind 'keyword'

* Reduce code duplication

* rustify PortsOrGenericsExtractor

* Remove unused function

* Refactor for any keyword and use function instead of text

* Conditional snippet support

* Don't complete when the last token is not a left par or comma

* Also complete with an identifier on the right hand side

* Refactor: standalone functions from methods

* Remove serde dependency from vhdl_lang

* clippy

* symmetry in docstring
2023-11-02 22:15:52 +01:00
Olof Kraigher
4732a6ce18
Merge pull request #206 from Schottkyc137/parse-subprogram-header
Parse subprogram header and parameter keyword
2023-10-29 16:33:32 +01:00
Lukas Scheller
e33b5cddd6 Analyze subprogram header 2023-10-29 08:41:35 +01:00
Lukas Scheller
b04e58b69f Implement search and visitor 2023-10-28 19:27:34 +02:00
Lukas Scheller
037ec90b25 Change order of parameter token 2023-10-28 19:18:33 +02:00
Lukas Scheller
b037decc30 Add additional test 2023-10-28 19:16:46 +02:00
Lukas Scheller
8335dba62c Add optional parameter keyword 2023-10-28 19:05:33 +02:00
Lukas Scheller
6ff2ab47c8 Include header in AST 2023-10-28 18:52:44 +02:00
Lukas Scheller
399398768c Enable subprogram header parsing 2023-10-28 18:41:17 +02:00
Olof Kraigher
a6cc02fd7d
Merge pull request #204 from Schottkyc137/map-aspect-lax-parsing
Improve diagnostics for map aspects
2023-10-21 10:33:55 +02:00
Lukas Scheller
5da474c433 grammar 2023-10-21 10:18:55 +02:00