serkonda7 / vscode-vba

VBA language extension to use with VS Code. Also used for syntax highlighting on GitHub.
https://marketplace.visualstudio.com/items?itemName=serkonda7.vscode-vba
Mozilla Public License 2.0
32 stars 12 forks source link

Opening files in _ascii_ encoding #29

Open h8nor opened 2 years ago

h8nor commented 2 years ago

Added ability to manage the editor's settings extension https://code.visualstudio.com/updates/v1_63#_configuration-defaults-overrides I would like to open the files *.bas in the encoding of ascii (required condition for import modules).


    "contributes": {

        "configuration": {
            "title": "VBA",
            "type": "object",
            "properties": {
                "vscodeVBA.Charset": {
                    "type": "string",
                    "enum": [
                        "windows1250",
                        "windows1251",
                        "windows1252",
                        "windows1253",
                        "windows1254",
                        "windows1255",
                        "windows1256",
                        "windows1257",
                        "windows1258"
                    ],
                    "description": "Default charset vba file",
                    "default": "windows1250"
                }
            }
        },
        "configurationDefaults": {
            "[cls][frm][vba]": {
                "editor.rulers": [
                    {
                        "column": 80,
                        "color": "#ff0000"
                    }
                ],
                "files.encoding": "${vscode.workspace.getConfiguration('vscodeVBA').get('Charset') as 'windows1250' || 'windows1251' || 'windows1252' || 'windows1253' || 'windows1254' || 'windows1255' || 'windows1256' || 'windows1257' || 'windows1258';}"
            }
        },

        }

It is impossible to apply directly object and properties, so debugger requires value from enums for vscodeVBA.Charset. It was assumed that user itself would configure ascii code page that meets its language.

Also added the boundaries of characters on a string (ruler) that work in the setting.

Unfortunately, I do not have enough knowledge to compile src. Maybe you will have opportunity to realize the idea.

serkonda7 commented 2 years ago

Really good idea. This should reduce possible encoding incompatibilities with Office's VBA Editor.

At the moment, I have limited time so this might take a while for me but I could add instructions on how to work on the extension some time soon.

h8nor commented 2 years ago

@serkonda7 it'll be generously on your part. I'm interested in contribution of this useful extension.

h8nor commented 1 year ago

Non obvious problem in the vscode when comparing commits. We must use an additional setting for our formats.

https://code.visualstudio.com/updates/v1_48#_browser-support