Due to some kind of networking issue that's render...
# ide
s
Due to some kind of networking issue that's rendering my beloved Sublime Text completely unusable, I'm being forced to switch to the clearly inferior, VSCode. 😩 Aside from the suboptimal syntax highlighting, my biggest gripe is that I'm no longer able to click on a function call to be taken to where that function is defined. I feel like this should work, and it does in Sublime, but every function results in 'No definition found'. Does anyone know if there's something I can do to get this working again? For context, I have a bunch of CFCs outside the web root (but within the VSCode workspace) that are largely instantiated as singletons in the Application scope and called throughout the codebase. e.g.
<http://Application.com|Application.com>.products.getProductRecord(1234)
, where
getProductRecord
is defined in
com/products/getProductRecord.cfm
, which is included in
com/products/products.cfc
Sublime Text handles this with no problem - if I hover over the
getProductRecord(1234)
call, it shows me a link to the
getProductRecord.cfm
, but VSCode can't find it. Any advice?
b
How are you opening the code in VS?
s
I've added my webroot and my component folders to the workspace.
b
Did that help?
s
It did not! 😉
r
What CFML extensions are you using? Make sure it's the one by KamasamaK.
s
I had a couple of others, but I've uninstalled them now. No difference unfortunately.
r
I've only ever used a single folder in a workspace and it works fine. I haven't used it, but there is an option for mappings in CFML settings that may help.
You may have to enable User Functions > Search under CFML options as well.
s
I tried removing the folders and adding the parent folder which then contains both the root and component folders, but that didn't work either. I also tried editing the mapping settings, to no avail. 😞
r
FYI, it's very easy to adjust or extend the syntax highlighting. I've added the following in my settings file to add some italics and underline my classes. This will overrides any color theme settings.
Copy code
"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "constant.language.boolean",
                    "entity.name.function",
                    "keyword",
                    "storage.type",
                    "support.function",
                    "variable.language.scope"
                ],
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": [
                    "entity.name.class.cfml"
                ],
                "settings": {
                    "fontStyle": "italic underline"
                }
            }
        ]
    }
s
Cool, I'll take a look. My understanding though, is that Sublime's syntax highlighting is just more capable that what VSCode uses. I've seen an issue open about it that's been going on for years!
r
Probably, but not by a lot. Just a lot of lazy developers trying to be first to port a theme.
m
@simiane did you try @Rodney suggestion for the user function > search, because that should work. it is a tad awkward when it has conflicts, but should be functional
s
I did... no difference unfortunately.
m
I'm wondering if it is related to being in a .cfm rather than a .cfc, maybe they aren't indexed the same or something. you should be able to highlight the function name and ctl + shift + f, and get list of all the matches pretty quickly, but unfortunately likely not what you'd prefer. I don't think I had ever tried to jump from a function call into a separate .cfm file, they were all into .cfc's.