Comments (6)
I understand the bit about changing the prefix to be the full name - that makes sense. But I don't understand the part about adding the path (symbols/SimpleMarkerSymbol)?
from arcgis-js-vscode-snippets.
Update: This has been added to the description
Yes, maybe SimpleMarkerSymbols wasn't the best example. I was thinking of snippets like map
, webmap
, webscene
, labeling2d
and labeling3d
, which return a snippet with a new ClassName
:
"CreateWebMap": {
"body": [
"var webmap = new WebMap({",
"\tportalItem: {",
"\t\tid: \"${1:webmap_id}\"",
"\t}",
"});",
"var view = new MapView({",
"\tcontainer: \"${2:viewDiv}\",",
"\tmap: webmap",
"});"
],
"description": "Create web map and a map view",
"prefix": "webmap"
},
On snippets like this, you might need to add an element to the require
function to load the class. So in order to save the developer to go to the developer site and search for the path to that class, I was thinking that it might be useful to it somewhere in VS Code. It might be also in the description.
require(["esri/views/MapView", function(MapView) {
// Instantiate MapView
const view = new MapView({
container: "viewDiv",
map: {
basemap: "topo"
}
});
});
After using the snippet you will also have to add the dependency to therequire
:
require(["esri/views/MapView", "esri/WebMap"], function(MapView, WebMap) {
// Instantiate WebMap
var webmap = new WebMap({
portalItem: {
id: "webmap_id"
}
});
// Instantiate MapView
const view = new MapView({
container: "viewDiv",
map: webmap
});
});
Does it make sense to add a suffix to every ArcGIS-related snippet is clearly different from all the other autocompletion
from arcgis-js-vscode-snippets.
@hhkaos ok now I see what you mean. Yes I think it might be good to include the path. I'll look into adding it for the existing snippets and play around with it for a day and see how it feels to use the snippets.
from arcgis-js-vscode-snippets.
I looked at adding the path but I'm not sure yet where the best spot to add it would be. I did some testing but want to do some more research to see if I can find some best practices info. I did update the prefix to use the longer names.
from arcgis-js-vscode-snippets.
Hi Kelly, thanks for the update!.
I have been thinking about this, and maybe it is enough just to add the path to the module in the description. What do you think about that?
While doing the cheatsheet & snippets builder I realized that having a "Checklist" with all the conventions would be awesome. I have seen quite a bit of heterogeneity in the way snippets are written/named/described, so I think it would be very helpful in order to make this repo grow properly. Does it make sense?
If you think it does, I would open an issue for each field (body conventions, name conventions ...) to brainstorm and discuss the best way to define each one, and have a place refer in the contributing white but also to revisit for enhancements if needed in the future.
I would maybe rename this one to
Enhance some prefixes> prefix conventions
from arcgis-js-vscode-snippets.
So I guess with the convention that in JavaScript we use autocasting as much as possible, then the problem of importing is not so dramatic. And in TypeScript you can easily use autoimports...
But I see what you mean, I always have to go to the doc to figure out where that LabelClass is placed :D And I think you said you'd like to add class imports for JavaScript as well, so then people will really have to make a lot of imports.
from arcgis-js-vscode-snippets.
Related Issues (20)
- Snippets cheatsheet HOT 7
- Add Snippets builder to enhance the contribution experience HOT 4
- Snippet proposal: Load a MapView (2D) HOT 2
- Snippet proposal: Find a layer by it's name HOT 4
- Snippet "body" conventions HOT 7
- Snippet "name" conventions
- Snippet "description" conventions HOT 4
- Review existing JavaScript snippets (conventions) HOT 4
- Customize icon for snippets suggestions HOT 1
- Programmatically create UI/cheat sheet to explore snippets HOT 1
- Add snippets for all Symbol classes HOT 1
- Add snippets for all Layer classes HOT 1
- Add basic snippets
- Improve contributing guidelines
- Update extension icon
- 🎃 𝗛𝗮𝗰𝗸𝘁𝗼𝗯𝗲𝗿𝗳𝗲𝘀𝘁 𝗗𝗲𝘁𝗮𝗶𝗹𝘀 𝗳𝗼𝗿 𝗣𝗮𝗿𝘁𝗶𝗰𝗶𝗽𝗮𝗻𝘁𝘀 👨💻
- Add snippets for Search widget (different configurations)
- Enhance snippets to work with basemaps (using API keys) & JS SDK 4.x HOT 1
- Enhance snippets builder
- Improve contributing guidelines HOT 1
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 arcgis-js-vscode-snippets.