-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document highlight for symbols (field names, model names, external ids,...) #39
Comments
Could this issue be related to undefined methods being referenced in field attributes, such as a compute method that hasn't been defined yet? Currently, in my VSCode, there's no warning or highlight indicator for such cases, making it difficult to identify undefined methods being referenced. When can we expect this issue to be resolved? |
No, the document highlight feature is about highlighting all references to the symbol under the cursor. Yours is another problem. Can you take a screenshot to demonstrate the problem? |
Thank you for the clarification! I was searching for an existing issue that might match the problem I’m facing because I want to avoid creating a duplicate issue. I thought this issue might be related, so I wanted to confirm. The expected behavior is that if a method referenced in the compute attribute of a field is not defined or doesn't exist, there should be a red highlight or a similar warning—like the functionality available in PyCharm. Currently, no such indicator appears in VSCode. |
That's strange because on my side it doesn't seem to work as expected. Do you think I should open a separate issue for this? I've changed the code in the Odoo source to match yours, but I still don't see any warning or indicator when an invalid method is referenced in the compute attribute of a field. I've attached a screenshot to demonstrate this. For additional context, here's my setup: 📌 VSCode version:
📌 Extension version:
📌 Installed inside a devcontainer 📌 Using a multi-root workspace (configuration attached) {
"folders": [
{
"path": "."
},
{
"path": "/oo"
}
],
"settings": {
"remote.autoForwardPorts": false,
"remote.restoreForwardedPorts": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/__pycache__": true,
"**/.idea": true
},
"search.exclude": {
"workdir/data/**/*": true
},
"git.repositoryScanMaxDepth": 3,
"git.allowForcePush": true,
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.createEnvironment.trigger": "off",
"python.languageServer": "None",
"python.analysis.stubPath": "",
"autopep8.args": [
"--max-line-length=119"
],
"xml.format.maxLineWidth": 120,
"xml.format.spaceBeforeEmptyCloseTag": false,
"editor.rulers": [
{
"column": 120
}
],
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8",
"editor.rulers": [
{
"column": 79
},
{
"column": 119
}
]
},
"debug.showInStatusBar": "always"
}
} The extension log also confirms that the file is being analyzed, so it seems the extension is functioning correctly. Let me know if there's anything else you'd like me to check. |
Are other features of the Odoo IDE extension still working (code completion for method names in |
Yes, everything else is working perfectly. Code completion for method names: Code completion for model names: Additionally, 'Go to Definition' is functioning correctly as well. Everything else seems to be working as expected. |
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentHighlight
The text was updated successfully, but these errors were encountered: