MVVS: MV Basic for Visual Studio

 View Only
Expand all | Collapse all

Getting Code Lens to be enabled when starting VS Code

  • 1.  Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-14-2024 00:33
    Edited by Gregor Scott 03-14-2024 01:47

    I have noted that the MV BASIC extension creates ".vscode" subdirectories with a simple settings.json file containing

    "settings": {
        "[rocket-mvbasic]": {
          "editor.codeLens": false
        }
    }

    This appears to be how the Code Lens functionality is turned off by default.

    If I adjust this file to use "true" instead of "false" then I do get the functions and variables presented in the Outline view as well as in the breadcrumbs facility.

    What I don't get is the reference count functionality shown in Code Lens - Rocket MV BASIC

    Rocketsoftware remove preview
    Code Lens - Rocket MV BASIC
    Code lens allows you to review your code and find references to variables, functions or subroutines without leaving the editor. To list these references, click the hyperlink as illustrated below. The hyperlink is highlighted when you hover your cursor over the text. Since 1.2.0 release, this feature is disabled by default.
    View this on Rocketsoftware >

    I can use the <ctrl><shift>p and enter "Enable Code Lens" to get the reference count links showing.

    What I don't understand is why the settings change to "true" does not also make that available.
    Is there another setting that controls the display of the reference count links in-line with the code?



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 2.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-14-2024 01:54

    My testing so far has me thinking that this setup in the settings.json file will enable the code lens functionality within the editor and the Outline panel, whilst disabling the in-line reference count links:

    "settings": {
        "[rocket-mvbasic]": {
          "editor.codeLens": true
        }
       "editor.codeLens": false
     }

    It is also possible to customize what is presented in the breadcrumbs and outline panels.

    The  setting "breadcrumbs.showFunctions" controls the display of GCI functions and internal subroutine names
    The setting "breadcrumbs.showVariables", obviously, controls the display of all variable names.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 3.  RE: Getting Code Lens to be enabled when starting VS Code

    ROCKETEER
    Posted 03-14-2024 02:03

    Hi, Gregor.

    I just checked this on my local environment but I couldn't see the same problem, below is the default content in the ".vscode/settings.json" file, could you please backup your current ".vscode/settings.json" file and replace with below? Also, is this VS Code running on the Linux server?

    {
        "[rocket-mvbasic]": {
            "editor.codeLens": false
        },
        "files.associations": {
            "**/BP/*": "rocket-mvbasic",
            "**/PBP/*": "rocket-mvbasic",
            "**/.rmv/config/*.json": "jsonc"
        },
        "files.exclude": {
            "**/.git": true,
            "**/.svn": true,
            "**/.hg": true,
            "**/CVS": true,
            "**/.DS_Store": true,
            "**/Thumbs.db": true,
            "**/.rmv/catalog/**": true,
            "*/_*": false
        }
    }

    Best Regards.



    ------------------------------
    Chao Han
    Rocket Internal - All Brands
    Dalian CN
    ------------------------------



  • 4.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-14-2024 21:22

    Hi Charles,

    My testing has been on a RHEL server, running VS Code via X11 forwarding to my PC.

    Which directory do you have the above ".vscode/settings.json" file stored in?



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 5.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-14-2024 21:47
      |   view attached

    I tested your .vscode/settings.json file by placing it in the /usr/uv directory.

    I also tested a number of variations.

    None of the settings.json variations resulted in the code lens functionality being presented.

    The only way to see it with the setup tested was to directly open the program from the command line when launching VS Code.

    I'm going to try another set of tests, outside of the /usr/uv directory incase user permissions are silently impacting things.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------

    Attachment(s)



  • 6.  RE: Getting Code Lens to be enabled when starting VS Code

    ROCKETEER
    Posted 03-14-2024 23:32

    Hi, Gregor.

    Thanks for the update and now I can see the problem, when you open a single BASIC program directly in the VS Code, MV BASIC extension will not working properly, you have to open account folder in the VS Code for the off-line editing mode, that's why you can only see "User" settings in the VS Code.

    For the ".vscode/settings.json" file, this file will be created under currently opened folder("/usr/uv/.vscode/settings.json" for you environment) when you activated Rocket MV BASIC extension first time. But on the Linux environment, VS Code extension is not initialized properly with wrong file-path and caused some issues, currently I didn't see a workaround for this.

    I know you can not copy BASIC code to the local side, but considerate with currently issues on the Linux environment, is that possible to try out with online editing mode for instead? We don't support compile/catalog/debug BASIC in the online editing mode yet, but the editing features should be fine.



    ------------------------------
    Chao Han
    Rocket Internal - All Brands
    Dalian CN
    ------------------------------



  • 7.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-14-2024 23:52
      |   view attached

    There certainly seems to be something weird going on with the loading of the settings.json file.

    Attached is the results from testing vscode in a non-root folder.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 8.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-15-2024 00:24
      |   view attached

    Testing using a worspace file instead of a settings.json shows another variation.

    This resulted in the enabeled codeLens setting for the Rocket MV BASIC extension being recognised within VS Code (as in, the settings editor showed the same value as that on disk).

    However, the full codelens functionality is not presented.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 9.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-15-2024 00:21

    Hi Charles,

    would the path duplication bug on Linux cause the weird differences in handling the codeLens setting at runtime?



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 10.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-15-2024 00:27

    There is no chance of us testing using VS code with source local to the PC.

    That is why I am attempting to get a known functional setup defined on linux.

    If the path duplication bug is impacting this, how far away is the fix for it as it is having quite an impact on the Linux experience.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 11.  RE: Getting Code Lens to be enabled when starting VS Code

    ROCKETEER
    Posted 03-15-2024 02:22

    Hi, Gregor.

    You don't need to copy source code to the local server side with online editing mode and I believe this can provide most editing features like offline editing mode, please refer to below link for more details:

    • https://rocketsoftware.github.io/rocket-mvbasic/usage/OnlineEditing/

    For the Linux environment, the duplicated path issue will cause a lot of issues since the configuration files were not initialized properly. Although you can manually create some configuration files or update content in it, but our extension may not working as expectedly. Also, not all features are supported on the Linux side, thus we always recommend user to copy source code to the local side, or just using online-editing mode, thanks.



    ------------------------------
    Chao Han
    Rocket Internal - All Brands
    Dalian CN
    ------------------------------



  • 12.  RE: Getting Code Lens to be enabled when starting VS Code

    PARTNER
    Posted 03-15-2024 02:31

    Hi Chao

    We run UV with NLS active, and there is a bug with MVVS on NLS servers that causes it problems when it is looking for files in an account VOC and the VOC contains items with a "?" in the key - which we do have.

    There is also the distinct lack of filtering for accounts and files that makes on-line mode cumbersome to navigate compared to offline mode.

    I am surprised by your comment "Also, not all features are supported on the Linux side," as I have not seen anything that details this.

    Can you point me at documentation on what is not supported when running in Linux ?

    Thanks



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 13.  RE: Getting Code Lens to be enabled when starting VS Code

    ROCKETEER
    Posted 03-17-2024 19:56

    Hi, Gregor.

    For Linux platform limitation, the major one is the online editing mode feature, but considerate that Q-pointer issue, you probably wouldn't use that for now, I will discuss this with management and Dev team to see if they have a better solution.

    https://rocketsoftware.github.io/rocket-mvbasic/usage/OnlineEditing/

    • Note: VS Code version 1.75 or higher is required to use this feature. Only Windows is supported in this preview version.


    ------------------------------
    Chao Han
    Rocket Internal - All Brands
    Dalian CN
    ------------------------------