Comments (6)
I would like to add Arduino Support for this extension @deerawan. So I already looked at it and it seems like VSCode sees Arduino .ino file as a .cpp file, because the output of the vscode.window.activeEditor.document.languageId
is cpp
for ino
files. That means you can add Arduino support by adding arduino
as a key to the value cpp
in the package.json
file. But adding a new key/value pair for arduino itself will not work, because VSCode sees Arduino files as cpp files.
So should I just add it to the cpp value? I would like to hear from you @deerawan.
from vscode-dash.
Now I can also fix this by adding this little if statement in the function getDocSets()
in extension.ts
to force it to get the arduino languageId correctly.
So then the function will be:
/**
* Get docset configuration
*
* @param {string} languageId e.g javascript, ruby
* @return {string}
*/
function getDocsets(): string[] {
const editor = getEditor() as TextEditor;
const fileName = path.basename(editor.document.fileName);
const languageId = editor.document.languageId;
const fileNameDocsets = getFileNameDocsets(fileName);
var languageIdDocsets = getLanguageIdDocsets(languageId);
// To get arduino fileName correctly, because VSCode editor.document.languageId is cpp for arduino(ino) files!
if (fileName.split('.').pop() == 'ino') {
languageIdDocsets = getLanguageIdDocsets('arduino');
}
// prioritize docset matching by file name then language id
return [...fileNameDocsets, ...languageIdDocsets];
}
What do you think is better @deerawan. Maybe there is another way that I do not know of, but that is the only way I could add support for Arduino.
from vscode-dash.
Hi @akdir, just noticed your message. Thank you.
Let me do some investigation.
from vscode-dash.
@akdir have you installed the extension https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino? This is in order to detect the language ID correctly.
from vscode-dash.
@akdir have you installed the extension https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino? This is in order to detect the language ID correctly.
@deerawan , Yes that is the first thing I did. That did not change the vscode.window.activeEditor.document.languageId
output, it is still cpp for ino
files. So I thought maybe VSCode sees ino files just as CPP files, because afterall the "programming language" Arduino is based on C/C++ but has some special functions to interact with Analog and Digital I/O.
from vscode-dash.
interesting, maybe we can do the alternative way by detecting the filename https://github.com/deerawan/vscode-dash#file-name-to-docset-matching
from vscode-dash.
Related Issues (20)
- Add dash to the Open VSX registry for open source users HOT 1
- Automatically perform search when focusing Dash
- Getting Zeal working: Install location HOT 1
- You'll need an app to open this dash plugin-link HOT 1
- dash error when ctrl+h hotkey (used to replace text)
- support for linux? HOT 2
- [Feature Request ]Works perfectly on Arch Linux with Zeal but needs an option to set arguments.
- Ansible search always includes colon
- If "Exact Docset" is enabled in settings it doesn't work
- Add support for Dash 5 HOT 3
- [Feature - Easy] Zeal Search: "language:searchword" HOT 1
- Support OCaml
- Support Gradle
- Support Haml HOT 1
- Ctrl+h doesn't do anything HOT 3
- Velocity Integration HOT 3
- Enable support for Zeal on macOS HOT 2
- [Request] Publish extension on open-vsx.org
- search error
- [Issue] Dash doesn't start from VS Code Extension HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-dash.