-
Notifications
You must be signed in to change notification settings - Fork 5
Ctags support for visual basic .net #11
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# See additional-language.ctags for maintaining this file. The type member specification for VB.NET can be found at https://learn.microsoft.com/en-us/dotnet/visual-basic/reference/language-specification/type-members | ||
--langdef=vbnet | ||
--langmap=vbnet:.vb | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Private|Protected|Friend|Overloads|Overrides|Overridable|NotOverridable|MustOverride|Shared|Shadows|Async|Iterator)\s+)*\s*(?:Function|Sub)\s+([A-Z_0-9\[\]]*)\(.*?\)\s*(?:As\s+[\w.]+)?/\1/m,method/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Default|Public|Private|Protected|Friend|Overloads|Overrides|Overridable|NotOverridable|MustOverride|Shared|Shadows|WriteOnly|ReadOnly|Iterator)\s+)*\s*(?:Property)\s+([A-Z_0-9\[\]]*)\s+As\s+/\1/p,property/ | ||
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. Should this regex have an extra check for Looking at one of the code examples here: Property Let Names(intX As Integer, intY As Integer, varZ As Variant)
' Statement here.
End Property
Property Get Names(intX As Integer, intY As Integer) As Variant
' Statement here.
End Property This regex seems like it'll misidentify 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. The link you provided is for VBA (Visual Basic for Applications). While this implementation is supposed to add support for Visual Basic (.NET). |
||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Private|Protected|Friend|Shared|Shadows|Custom)\s+)*\s*(?:Event)\s+([A-Z_0-9\[\]]*)/\1/E,event/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Private|Protected|Friend|Shadows|MustInherit|NotInheritable|Partial)\s+)*\s*(?:Class)\s+([A-Z_0-9\[\]]*)/\1/c,class/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Private|Protected|Friend|Shadows)\s+)*\s*(?:Interface)\s+([A-Z_0-9\[\]]*)/\1/i,interface/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Private|Protected|Friend|Shadows|Partial)\s+)*\s*(?:Structure)\s+([A-Z_0-9\[\]]*)/\1/s,struct/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Private|Protected|Friend|Shadows)\s+)*\s*(?:Enum)\s+([A-Z_0-9\[\]]*)/\1/g,enum/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Friend)\s+)*\s*(?:Module)\s+([A-Z_0-9\[\]]*)/\1/c,class/ | ||
--regex-vbnet=/^(?i)\s*(?:(?:Public|Overloads|Shared|Shadows|Widening|Narrowing)\s+)*\s*(?:Operator)\s+([\+\-\*\/\\=<>a-z]+)/\1/m,method/ |
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 have ~0 Visual Basic knowledge). Could you explain why this is using
m,method
instead off,function
? For example, Rust supports both methods and functions, so the output ofctags --list-kinds-full=Rust
has bothP method
andf function
.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.
There are actually two types in VB.NET Subs and Functions. The difference between them is that Functions have a return value while Subs do not. And since the [language-specification] (https://learn.microsoft.com/en-us/dotnet/visual-basic/reference/language-specification/type-members)calls both methods, I opted for that one.