http://coldfusion.com logo
#ide
Title
# ide
s

simiane

04/08/2022, 9:09 AM
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

Brian

04/08/2022, 11:32 AM
How are you opening the code in VS?
s

simiane

04/08/2022, 11:46 AM
I've added my webroot and my component folders to the workspace.
b

Brian

04/08/2022, 12:12 PM
Did that help?
s

simiane

04/08/2022, 12:12 PM
It did not! 😉
r

Rodney

04/08/2022, 12:58 PM
What CFML extensions are you using? Make sure it's the one by KamasamaK.
s

simiane

04/08/2022, 1:03 PM
I had a couple of others, but I've uninstalled them now. No difference unfortunately.
r

Rodney

04/08/2022, 1:07 PM
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

simiane

04/08/2022, 1:38 PM
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

Rodney

04/08/2022, 1:38 PM
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

simiane

04/08/2022, 1:45 PM
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

Rodney

04/08/2022, 1:46 PM
Probably, but not by a lot. Just a lot of lazy developers trying to be first to port a theme.
m

Matt Jones

04/08/2022, 1:56 PM
@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

simiane

04/08/2022, 2:11 PM
I did... no difference unfortunately.
m

Matt Jones

04/08/2022, 2:30 PM
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.
5 Views