We have recently developed the code lens feature in vs code extension and would like to share it to you.
This feature works for all basic definition statements, including: variable declarations, function declarations, equate declarations and label declarations. It also displays the number of references on these statements. Clicking on the value of a reference will display the specific reference information. See the following example for details.
Also, if you want the feature to prompt other information, or if you have other ideas or comments, please share with us.
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
This feature works for all basic definition statements, including: variable declarations, function declarations, equate declarations and label declarations. It also displays the number of references on these statements. Clicking on the value of a reference will display the specific reference information. See the following example for details.
Also, if you want the feature to prompt other information, or if you have other ideas or comments, please share with us.
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
Page 1 / 1
We have recently developed the code lens feature in vs code extension and would like to share it to you.
This feature works for all basic definition statements, including: variable declarations, function declarations, equate declarations and label declarations. It also displays the number of references on these statements. Clicking on the value of a reference will display the specific reference information. See the following example for details.
Also, if you want the feature to prompt other information, or if you have other ideas or comments, please share with us.
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
This feature works for all basic definition statements, including: variable declarations, function declarations, equate declarations and label declarations. It also displays the number of references on these statements. Clicking on the value of a reference will display the specific reference information. See the following example for details.
Also, if you want the feature to prompt other information, or if you have other ideas or comments, please share with us.
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
Nice feature.
Do you identify variables when first reference is not a assignent (like open x to f ; f no need to be declare before open)?
Do you 'open' the INCLUDES to add the declare elements as part of the current source ?
If we define internal subroutine, do you respect the scope of the in-subroutine variables vs 'main' variables.
Do you use the mecanics to make semantic naming différence between variables, equates names,...
May I suggest a 'comment pattern' to add a comment to a variable and show the comment on the tooltip.
Sample :
Var = 0 ;*TOOLTIP* Var is used to handle a number
F = '' ;*TOOLTIP* F is a opened file
Etc.
Thanks for you sharing
------------------------------
Manu Fernandes
------------------------------
Hi Jingeen Li
Nice feature.
Do you identify variables when first reference is not a assignent (like open x to f ; f no need to be declare before open)?
Do you 'open' the INCLUDES to add the declare elements as part of the current source ?
If we define internal subroutine, do you respect the scope of the in-subroutine variables vs 'main' variables.
Do you use the mecanics to make semantic naming différence between variables, equates names,...
May I suggest a 'comment pattern' to add a comment to a variable and show the comment on the tooltip.
Sample :
Var = 0 ;*TOOLTIP* Var is used to handle a number
F = '' ;*TOOLTIP* F is a opened file
Etc.
Thanks for you sharing
------------------------------
Manu Fernandes
------------------------------
Nice feature.
Do you identify variables when first reference is not a assignent (like open x to f ; f no need to be declare before open)?
Do you 'open' the INCLUDES to add the declare elements as part of the current source ?
If we define internal subroutine, do you respect the scope of the in-subroutine variables vs 'main' variables.
Do you use the mecanics to make semantic naming différence between variables, equates names,...
May I suggest a 'comment pattern' to add a comment to a variable and show the comment on the tooltip.
Sample :
Var = 0 ;*TOOLTIP* Var is used to handle a number
F = '' ;*TOOLTIP* F is a opened file
Etc.
Thanks for you sharing
------------------------------
Manu Fernandes
------------------------------
Thank you very much for your sharing and suggestions, it will help us a lot!
1. Regarding the open assignment statement, it can also be identified correctly. I missed it in my description and example, thanks for the reminder.
2.In the case of include, we do not consider it for now. If FILE_A include file FILE_B, and the variable VAR_A defined in FILE_B is used in FILE_A, there are two cases as follows:
(1) When FILE_A is opened, there will be no code lens information of VAR_A, because this variable is defined in FILE_B
(2) When FILE_B is opened, there will be code lens information of VAR_A, but the number of occurrences of FILE_A will not be counted, because we only parse which files are included in the current file, and the file is included in those files we do not consider for the time being. we are trying our best to find a solution.
3.Regarding scope, the support is not very good at the moment, we plan to optimize it gradually in the subsequent releases.
4.The current semantic highlight functionality is based on Standard token types and modifiers, so all variables are classified as variable token type. In the future, we will continue to optimize, customize BASIC's own token types and modifiers, and divide the different variable types in detail.
5.Generally, feature Code Lens provides some convenient methods for some frequently used operation. For this requirement, I think it's most likely related to feature Hover. We can consider add it to Hover, which means, when hover the cursor on a variable, the pattern comment would be displayed. Suggestions?
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
Hi Manu,
Thank you very much for your sharing and suggestions, it will help us a lot!
1. Regarding the open assignment statement, it can also be identified correctly. I missed it in my description and example, thanks for the reminder.
2.In the case of include, we do not consider it for now. If FILE_A include file FILE_B, and the variable VAR_A defined in FILE_B is used in FILE_A, there are two cases as follows:
(1) When FILE_A is opened, there will be no code lens information of VAR_A, because this variable is defined in FILE_B
(2) When FILE_B is opened, there will be code lens information of VAR_A, but the number of occurrences of FILE_A will not be counted, because we only parse which files are included in the current file, and the file is included in those files we do not consider for the time being. we are trying our best to find a solution.
3.Regarding scope, the support is not very good at the moment, we plan to optimize it gradually in the subsequent releases.
4.The current semantic highlight functionality is based on Standard token types and modifiers, so all variables are classified as variable token type. In the future, we will continue to optimize, customize BASIC's own token types and modifiers, and divide the different variable types in detail.
5.Generally, feature Code Lens provides some convenient methods for some frequently used operation. For this requirement, I think it's most likely related to feature Hover. We can consider add it to Hover, which means, when hover the cursor on a variable, the pattern comment would be displayed. Suggestions?
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
Thank you very much for your sharing and suggestions, it will help us a lot!
1. Regarding the open assignment statement, it can also be identified correctly. I missed it in my description and example, thanks for the reminder.
2.In the case of include, we do not consider it for now. If FILE_A include file FILE_B, and the variable VAR_A defined in FILE_B is used in FILE_A, there are two cases as follows:
(1) When FILE_A is opened, there will be no code lens information of VAR_A, because this variable is defined in FILE_B
(2) When FILE_B is opened, there will be code lens information of VAR_A, but the number of occurrences of FILE_A will not be counted, because we only parse which files are included in the current file, and the file is included in those files we do not consider for the time being. we are trying our best to find a solution.
3.Regarding scope, the support is not very good at the moment, we plan to optimize it gradually in the subsequent releases.
4.The current semantic highlight functionality is based on Standard token types and modifiers, so all variables are classified as variable token type. In the future, we will continue to optimize, customize BASIC's own token types and modifiers, and divide the different variable types in detail.
5.Generally, feature Code Lens provides some convenient methods for some frequently used operation. For this requirement, I think it's most likely related to feature Hover. We can consider add it to Hover, which means, when hover the cursor on a variable, the pattern comment would be displayed. Suggestions?
Thanks!
------------------------------
Jingwen Li
Rocket
------------------------------
Many thanks for the reply,
1/ Fine, I hope you do not miss the UDO (or other like it) functions which return UDO object you do not need to declare before calling :-)
2/ ok, I hope you keep the principle in mind. (and populate Outline panel with INCLUDE's symbol :-)
3/ Fine.
4/ may I suggest you use :
- SUBROUTINE subrname(argument )
-- subrname : token type : function
-- argument : token type : parameter (actually enumMember)
EQU eqname to xx
-- eqname : token type : variable ; modifier : declaration
OPEN x TO F ; READ R FROM F
-- F : token type : interface
...
the important is not the pure' semantic' relationship but the capacity to have a coloured distinction between variables like theses ... :
5/ I agree, I talk about Hover feature. ... but it's linked.
to populate Hover, I suggest a regex pattern on comment like : *!!!varname:comment
^\\*!!!(\\w*):(.*)$
But, I suppose a user-definable regex where you request 2 group (group1 = varname , group2 = comment )
6/ YOU MAKE A GREAT JOB
thanks
------------------------------
Manu Fernandes
------------------------------
Hi Jingeen Lit
Many thanks for the reply,
1/ Fine, I hope you do not miss the UDO (or other like it) functions which return UDO object you do not need to declare before calling :-)
2/ ok, I hope you keep the principle in mind. (and populate Outline panel with INCLUDE's symbol :-)
3/ Fine.
4/ may I suggest you use :
- SUBROUTINE subrname(argument )
-- subrname : token type : function
-- argument : token type : parameter (actually enumMember)
EQU eqname to xx
-- eqname : token type : variable ; modifier : declaration
OPEN x TO F ; READ R FROM F
-- F : token type : interface
...
the important is not the pure' semantic' relationship but the capacity to have a coloured distinction between variables like theses ... :
5/ I agree, I talk about Hover feature. ... but it's linked.
to populate Hover, I suggest a regex pattern on comment like : *!!!varname:comment
Many thanks for the reply,
1/ Fine, I hope you do not miss the UDO (or other like it) functions which return UDO object you do not need to declare before calling :-)
2/ ok, I hope you keep the principle in mind. (and populate Outline panel with INCLUDE's symbol :-)
3/ Fine.
4/ may I suggest you use :
- SUBROUTINE subrname(argument )
-- subrname : token type : function
-- argument : token type : parameter (actually enumMember)
EQU eqname to xx
-- eqname : token type : variable ; modifier : declaration
OPEN x TO F ; READ R FROM F
-- F : token type : interface
...
the important is not the pure' semantic' relationship but the capacity to have a coloured distinction between variables like theses ... :
5/ I agree, I talk about Hover feature. ... but it's linked.
to populate Hover, I suggest a regex pattern on comment like : *!!!varname:comment
^\\*!!!(\\w*):(.*)$
But, I suppose a user-definable regex where you request 2 group (group1 = varname , group2 = comment )
6/ YOU MAKE A GREAT JOB
thanks
------------------------------
Manu Fernandes
------------------------------
About these sharing and suggestions from you, they are very helpful and we will consider them seriously and include them in our follow-up development plan.
Thank you very much!
------------------------------
Jingwen Li
Rocket
------------------------------
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.

