diff --git a/.vscode/development.code-snippets b/.vscode/development.code-snippets
new file mode 100644
index 0000000..f308f82
--- /dev/null
+++ b/.vscode/development.code-snippets
@@ -0,0 +1,89 @@
+{
+ // Develop / test your contributions here
+
+ // JavaScript only snippet (*.js)
+ "A JavaScript only snippet": {
+ "scope": "javascript",
+ "prefix": "myConsoleLog",
+ "body": [
+ "console.log(\"Hello Map\");"
+ ],
+ "description": "Console log \"Hello Map\""
+ },
+
+ // HTML only snippet (*.html and *.htm)
+ "A HTML only snippet": {
+ "scope": "html",
+ "prefix": "dojoConfig",
+ "body": [
+ ""
+ ],
+ "description": "Loads dojoConfig"
+ },
+
+ // CSS only snippet (*.css)
+ "A CSS only snippet": {
+ "scope": "css",
+ "prefix": "smallMap",
+ "body": [
+ ".viewDiv{ width: 300px; height: 300px }"
+ ],
+ "description": "Set viewDiv to 300px x 300px"
+ },
+
+ // JSON only snippet (*.json and *.geojson)
+ "A JSON only snippet": {
+ "scope": "json",
+ "prefix": "featureCollectionPoint",
+ "body": [
+ "{",
+ "\t\"type\": \"FeatureCollection\",",
+ "\t\"features\": [",
+ "\t\t{",
+ "\t\t\t\"type\": \"Feature\",",
+ "\t\t\t\"properties\": {},",
+ "\t\t\t\"geometry\": {",
+ "\t\t\t\t\"coordinates\": [",
+ "\t\t\t\t\t-4.795935418929616,",
+ "\t\t\t\t\t38.74031154905251",
+ "\t\t\t\t],",
+ "\t\t\t\t\"type\": \"Point\"",
+ "\t\t\t}",
+ "\t\t}",
+ "\t]",
+ "}",
+ ],
+ "description": "Sample of camera position object"
+ },
+
+ // TypeScript (*.ts)
+ "A TypeScript only snippet": {
+ "scope": "typescript",
+ "body": [
+ "declare function myDebug(value: any): void;"
+ ],
+ "description": "Example using any and void",
+ "prefix": "myDebug"
+ },
+
+ // TypeScript React (*.tsx)
+ "A TypeScript only snippet": {
+ "scope": "typescriptreact",
+ "body": [
+ "const HelloWorld = () =>
Hello, World!
",
+ "export default HelloWorld",
+ ],
+ "description": "Hello world usint TypeScript and React",
+ "prefix": "helloWorldTSX"
+ }
+}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c841e9..5ce30b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,4 +32,40 @@ All notable changes to the "arcgis-jsapi-snippets" extension will be documented
- Added React Map snippet
- Added Calcite snippet
-- Added latest versions to the getAPI snippet
\ No newline at end of file
+- Added latest versions to the getAPI snippet
+
+## [Version 1.1.5]
+
+- Removed Calcite snippet
+- Added `requireApiKeys` snippet
+- Added `basemapsWithoutAPIKeys` snippet
+- New prefixes added to existing snippets to match conventions:
+ - `map` -> `MapViewMap`
+ - `scene` -> `SceneViewMap`
+ - `webmap` -> `MapViewWebMap`
+ - `webscene` -> `SceneViewWebScene`
+ - `simpleRenderer` -> `simpleRendererProps`
+ - `uniqueValueRenderer` -> `uniqueValueRendererProps`
+ - `classBreaksRenderer` -> `classBreaksRendererProps`
+ - `sizeVar` -> `sizeVisualVariableProps`
+ - `colorVar` -> `colorVarProps`
+ - `clusterConfig` -> `featureReductionClusterProps`
+ - `labeling2d` -> `LabelClass2D`
+ - `labeling3d` -> `LabelClass3D`
+ - `simpleMarkerSymbol` -> `simpleMarkerSymbolProps`
+ - `pictureMarkerSymbol` -> `pictureMarkerSymbolProps`
+ - `simpleLineSymbol` -> `simpleLineSymbolProps`
+ - `simpleFillSymbol` -> `simpleFillSymbolProps`
+ - `pictureFillSymbol` -> `pictureFillSymbolProps`
+ - `icon` -> `pointSymbol3dIconProps`
+ - `line` -> `lineSymbol3DProps`
+ - `path3d` -> `lineSymbol3DPathProps`
+ - `fillMesh3d` -> `fillMesh3dProps, meshSymbol3DProps`
+ - `waterSymbol3dLayer` -> `waterSymbol3dLayerProps`
+ - `extrudePolygon3d` -> `polygonSymbol3DExtrudeProps`
+ - `edges` -> `edges3DProps`
+ - `calloutSmall` -> `callout3DSmallProps`
+ - `calloutLarge` -> `callout3DLargeProps`
+ - `elevationInfo` -> `elevationInfoProps`
+ - `background` -> `sceneViewEnvironmentProps`
+ - `basemapStyle` -> `basemapsWithAPIKeys`
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2d938ac..c595ad6 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,85 +6,296 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines
**Table of Contents**
+- [Before you get started](#before-you-get-started)
+ - [How Visual Studio Intellisense works](#how-visual-studio-intellisense-works)
+ - [Project folder structure](#project-folder-structure)
- [I want to contribute, what should I work on?](#i-want-to-contribute-what-should-i-work-on)
-- [Getting a development environment set up](#getting-a-development-environment-set-up)
-- [Adding a new snippet](#adding-a-new-snippet)
+- [Suggesting new snippets](#suggesting-new-snippets)
+ - [JavaScript and TypeScript snippets](#javascript-and-typescript-snippets)
+ - [Other snippets](#other-snippets)
+- [Development environment](#development-environment)
+- [Add your changes](#add-your-changes)
+- [Commit message format](#commit-message-format)
+- [Pull request](#pull-request)
- [Conventions](#conventions)
- [`prefix`](#prefix)
- [`name`](#name)
- [`description`](#description)
- [`body`](#body)
-- [Pull request](#pull-request)
+- [FAQ](#faq)
- [Additional resources](#additional-resources)
+## Before you get started
+
+### How Visual Studio Intellisense works
+
+The first thing you should familiarize yourself with, if you have never created a custom snippet in Visual Studio Code, is the most important components that make up Intellisense (intelligent code completion) in Visual Studio Code:
+
+![](./images/vscode-intelisense-components.png)
+
+These fields are shown in the image above: `prefix`, `name`, `description`, and `body`, have to be defined in a JSON object that looks like this:
+
+```json
+"Layer View query features": {
+"prefix": ["layerView", "layerViewQF"],
+"body": [
+ "layerView.queryFeatures().then(function(results){",
+ "\tconsole.log(results.features);",
+ "});",
+],
+"description": "Get features in the layer"
+}
+```
+
+Where:
+* "Layer View query features": is the snippet name. It is displayed via IntelliSense if no `description` is provided
+* `prefix` defines **one or more** trigger words that display the snippet in IntelliSense. Substring matching (fuzzy search) is performed on prefixes, that's why in this case, "lq" matched "layerViewQF"
+* `body` is one or more lines of content, which will be joined as multiple lines upon insertion. Newlines and embedded tabs will be formatted according to the context in which the snippet is inserted.
+* `description` is a description of the snippet displayed by IntelliSense.
+
+> **Note**: there is another optional component ([scope](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-scope)) that can be used to specify in which context ([language](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers)) the snippet is relevant.
+
+To improve accessibility and usability, Visual Studio Code have a special syntax that can be used inside the `body`, for example [placeholders](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_placeholders), and [choices](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_choice):
+![IPlaceholders and Choices](./images/places-and-choices.png)
+
+Later on, we will see in which file(s) we will have to add this code and the user interface we provide to facilitate the creation of the snippet code.
+
+### Project folder structure
+
+The most relevant files and folders in this repository are:
+
+* **[.vscode/](./.vscode/)**: the most important file in this folder is `development.code-snippets` that you will use to test the snippets you will contribute.
+* **[builder/](./builder/)**: this folder include the code of the [Snippets Builder application](https://esri.github.io/arcgis-js-vscode-snippets/builder/).
+* **[dev/](./dev)**: this folder contains the files to help you during your development proccess, and the instructions on how to use them.
+* **[images/](./images/)**: contains the assets being used in the README files as well as the icon being use in the Visual Studio Code marketplace.
+* **[snippets/](./snippets/)**: this folder have all the available snippets within the official extension that is published (defined in the [package.json file](./package.json)).
+* **[CHANGELOG.md](./CHANGELOG.md)**: this file keeps a log or record of all notable changes made to the project.
+
## I want to contribute, what should I work on?
You can help mostly by:
-* Adding ideas for snippets using the [snippet builder](https://esri.github.io/arcgis-js-vscode-snippets/builder/).
-* Requesting updates for existing snippets by creating a [Enhancement issue](https://github.com/Esri/arcgis-js-vscode-snippets/issues/new?assignees=&labels=type%2Fenhancement%2C0+-+new%2Cneeds+triage&projects=&template=enhancement.yml).
-* Reporting problems by creating a [Bug issue](https://github.com/Esri/arcgis-js-vscode-snippets/issues/new?assignees=&labels=type%2Fenhancement%2C0+-+new%2Cneeds+triage&projects=&template=bug.yml).
-* Working on the issues marked as `help wanted`. There is also a `good first issue` label if you are just getting started.
+* **Adding ideas for snippets** using the [snippet builder](https://esri.github.io/arcgis-js-vscode-snippets/builder/). If you are planning to do so, check [Suggesting new snippets](#suggesting-new-snippets).
+* **Requesting enhancements** for existing snippets by creating a [Enhancement issue](https://github.com/Esri/arcgis-js-vscode-snippets/issues/new?assignees=&labels=type%2Fenhancement%2C0+-+new%2Cneeds+triage&projects=&template=enhancement.yml).
+* **Reporting problems** by creating a [Bug issue](https://github.com/Esri/arcgis-js-vscode-snippets/issues/new?assignees=&labels=type%2Fenhancement%2C0+-+new%2Cneeds+triage&projects=&template=bug.yml).
+* **Working on the issues** marked as `help wanted`. There is also a `good first issue` label if you are just getting started.
* Comment on the issue and check if any additional context is needed before you start working. This will also help everyone knows that you are already working on it.
-* Sharing your own list to the [community snippets](https://github.com/Esri/arcgis-js-vscode-snippets#community-snippets)
+* **Sharing your own list of snippets** to the [community snippets](https://github.com/Esri/arcgis-js-vscode-snippets#community-snippets)
+
+## Suggesting new snippets
+
+If you plan to propose new snippets, this section contains an overview of the main type of snippets this extension contains for each language, but if you have any another idea(s), do not hesitate to share them.
+
+### JavaScript and TypeScript snippets
+
+The list below summarize the main type of snippets within [snippets/javascript.json](./snippets/javascript.json), [snippets/typescript.json](./snippets/typescript.json), and [snippets/typescriptreact.json](./snippets/typescriptreact.json).
+
+**1) Initialization of classes.**
+
+Instantiate an object of a new class like MapView, FeatureLayers, widgets (e.g. Search widget with multple configurations: multiple sources, custom sources, ...).
+
+Examples: `FeatureLayerClientSide`
+
+```js
+new FeatureLayer({
+ fields: [{
+ name: "OBJECTID",
+ type: "oid"
+ }, {
+ name: "${1:url}",
+ type: "string"
+ }],
+ objectIdField: "OBJECTID",
+ popupTemplate: {
+ content: "${2:}"
+ },
+ renderer: ${3:Renderer},
+ source: ${4:graphics},
+});
+```
+
+**2) JS objects with constructor properties**
+
+JavaScript objects to facilitate class configuration:
+
+Examples: `featureReductionClusterProps`
-## Getting a development environment set up
+```js
+{
+ type: "cluster",
+ clusterMaxSize: ${1:37.5},
+ clusterMinSize: ${2:16.5},
+ clusterRadius: ${3:60},
+ labelingInfo: ${4:LabelClass},
+ labelsVisible: true,
+ popupEnabled: true,
+ popupTemplate: ${5:PopupTemplate}
+}
+```
-> **Note**: to avoid conflicts, we do not recommend editing the local installation of the plugin placed in (`~/.vscode/extensions/esri.arcgis-jsapi-snippets-version`)
+**3) Common procedures and programming patterns**
+
+Like query a layer, disable navigation, project a geometry, ...
+
+Example: `queryLayerView`
+
+```js
+view.whenLayerView(${1:fl}).then(function (layerView) {
+ layerView.queryFeatures().then(function (results) {
+ console.log(results.features);
+ });
+});
+```
+**4) Enumeration of possible values**
+
+Snippets to help choosing between multiple enumerations, like [basemap styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), [renderer types](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#type), [symbol types](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#type), [layer types](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#type), ...
+
+Example: `basemapsWithAPIKeys`
+
+```
+${1|arcgis-imagery,arcgis-imagery-standard,arcgis-imagery-labels,arcgis-light-gray,arcgis-dark-gray,arcgis-navigation,arcgis-navigation-night,arcgis-streets,arcgis-streets-night,arcgis-streets-relief,arcgis-topographic,arcgis-oceans,osm-standard,osm-standard-relief,osm-streets,osm-streets-relief,osm-light-gray,osm-dark-gray,arcgis-terrain,arcgis-community,arcgis-charted-territory,arcgis-colored-pencil,arcgis-nova,arcgis-modern-antique,arcgis-midcentury,arcgis-newspaper,arcgis-hillshade-light,arcgis-hillshade-dark|}
+```
-**Steps:**
+### Other snippets
-1. In VSCode show command palette pressing: `Cmd + Shift + P` (Windows: `Ctrl + Shift + P`) then type/select `Preferences: Configure User Snippets`.
-2. Select your preferred option, `New Global Snippets file...` or the folder you want to place the snippets file.
-3. Depending on the type of snippet you want to add, you need to type: `html.json`, `javascript.json`, `json.json`, `typescript.json` or `typescriptreact.json.`
-4. Now you can test it there. You will need to use the command palette again but instead, type `Developer: Reload Window` for VSCode to recognize the new snippet.
+The list of snippets within [html.json](./snippets/html.json), and [json.json](./snippets/json.json) is short, so we encourage you to check yourself.
-## Adding a new snippet
-We accept different type of snippets:
+## Development environment
-* Initialization of classes. (E.g. `new FeatureLayer({ ... })`).
-* JS objects with constructor properties (`{ url: ... }`).
-* Common procedures (E.g. query a layer, disable navigation, project a geometry, ...).
-* Enumeration of possible values (E.g: basemap styles, renderer and symbol types, ...).
+At this point you are almost ready to start doing your contribution.
-Consider using the [snippet builder](https://esri.github.io/arcgis-js-vscode-snippets/builder/) to validate your snippet, and please make sure it follows the [conventions](#conventions).
+Go to the [dev folder](./dev), and read the instructions to learn how to setup and use your local development environment.
+
+## Add your changes
+
+Do you have your contribution ready? If so, keep reading.
+
+Although it is possible to make your changes directly through the GitHub web interface, we recommend that you add your changes to a local copy of the repository.
+
+**Which branch should I use?**
+If your are not doing a lot of changes you can use `master`, otherwise we encourage you to do the changes in a new branch. Branch name convention:
+* For changes associated with an issue: `/-`.
+* For changes without an associated issue: `/`.
+
+**Checklist before doing a Pull Request**
+Please ensure that you have completed the following steps before making a PR:
+
+1. Update the corresponding file in the [snippets folder](./snippets). Depending on the type of snippet, you need to will have to modify: `html.json`, `javascript.json`, `json.json`, `typescript.json`, ...
+ 1. Make sure your snippet meets [our conventions]((#conventions)).
+ 2. Make sure snippets are sorted in the alphabetical order, by `name`). Use any [JSON ABC](https://novicelab.org/jsonabc/) **checking "Spare plain Arrays"**.
+ 3. Validate JSON and indentation with [JSONLint](https://jsonlint.com/).
+2. Update the snippets table within the [README.md](./README.md) to reflect the changes.
+3. Update the [CHANGELOG.md](./CHANGELOG.md) file to reflect the changes.
+4. Commit your changes.
+
+## Commit message format
+
+This project do not strictly follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), but we will use the format `: description [optional #issue-number]` to generate the changelog. Be sure to provide clear and sufficient information in commit messages.
+
+For `` you should use:
+
+* **feat**: A new snippet or feature
+* **fix**: A bug fix with the snippet
+* **docs**: Documentation only changes (changes in markdown)
+* **style**: Changes that do not affect the meaning of the code (conventions, white-space, formatting, missing semi-colons, etc)
+* **refactor**: A code change that neither fixes a bug nor adds a feature
+
+`description`:
+
+* The subject contains succinct description of the change
+* use the imperative, present tense: "change" not "changed" nor "changes"
+* do not capitalize first letter
+* do not place a period . at the end
+* entire length of the subject must not go over 50 characters
+* describe what the commit does, not what issue it relates to or fixes
+* **be brief, yet descriptive** - we should have a good understanding of what the commit does by reading the subject
+
+**Examples:**
+* `style: apply prefix conventions to all snippets #30`
+* `doc: update contributing guidelines and minor conventions changes #37`
+
+## Pull request
+
+> **Reminder**: before doing a PR, ensure that you have completed the checklist included in [Add your changes](#add-your-changes).
+
+When submitting:
+* If you are adding a new snippet, please provide a codepen example to help during the review process.
+* If you are working on an issue, remember to [link your PR to it](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue), by use a supported keyword in the pull request description. For example: "`Closes #10`" or "`Fixes Esri/arcgis-js-vscode-snippets#10`".
## Conventions
### `prefix`
+Prefix are the trigger words that display the snippet in the Intellisense:
+
+
+
* Avoid acronyms (like `sms` for `SimpleMarkerSymbol`)
-* Use camelcase (not [snake_case](https://en.wikipedia.org/wiki/Snake_case), UPPERCASE, etc.)
+* Use camelCase (not [snake_case](https://en.wikipedia.org/wiki/Snake_case), UPPERCASE, etc.)
* Per snippet type:
* **Class properties objects**: add the suffix "Props".
* **Class constructors**: match JS SDK capitalization.
+> **⚠️ Important**: when changing an exist prefix, or backwards compatibility, if the new prefix is totally different, instead of removing the previous prefix, add a new one (`prefix` support `strings` and `arrays`), but new one as the first element in the array.
+
+**Examples**:
+* Class constructors: `SimpleMarkerSymbol`, `MapView`, ...
+* Class properties objects: `popupTemplateProps`, `featureReductionClusterProps`...
+* Common procedures an enumerations: `basemapsWithAPIKeys`, `findLayerByTitle`, ...
+
> If you want to suggest a change, please [check the issue #10](https://github.com/Esri/arcgis-js-vscode-snippets/issues/10).
### `name`
+Name is the short description that follows the prefix:
+
+
+
* Start your sentence with capitals (do not capitalize, uppercase)
* Use plain english using spaces as needed (don't use [camelCase](https://en.wikipedia.org/wiki/Camel_case), [snake_case](https://en.wikipedia.org/wiki/Snake_case), [PascalCase](https://www.freecodecamp.org/news/snake-case-vs-camel-case-vs-pascal-case-vs-kebab-case-whats-the-difference/#pascal-case), or [kebab-case](https://en.wikipedia.org/wiki/Letter_case#Kebab_case)).
-* Keep the name short as possible (< 35 characters) to avoid ellipsis ("...").
+* Keep the name short as possible to avoid ellipsis ("..."). Ideally it should be less than 35 characters, but it also depends on the prefix(es) length, so try and adjust it.
+
+**Examples**:
+* `City scale 3D callout`
+* `Create class breaks renderer`
+* `Create 3D extruded polygon symbol`
+* `Generate icon Point 3D`
> If you want to suggest a change, please [check the issue #20](https://github.com/Esri/arcgis-js-vscode-snippets/issues/20).
### `description`
+Description is a long description that precedes the body:
+
+
+
* It should be a proper description of what the snippet does, and reuse text from the API reference whenever possible.
-* If it is a snippet related to a class/module include the AMD and ESM paths. For example: `Convert a geometry from Web Mercator units (wkid: 3857) to geographic units (wkid: 4326). AMD path: esri/geometry/support/webMercatorUtils | ESM path: @arcgis/core/geometry/support/webMercatorUtils.js`
+* For "Initialization of classes" snippets finish with: `AMD path: | ESM path: `
+* For "JS objects with constructor properties" finish with: `This snippet is usually used to set the property \"\" of a `
+
+Examples:
+* `Load the config, Map and MapView modules using require.`
+* `Use of these basemaps requires a valid ArcGIS Online organizational subscription or an ArcGIS Enterprise license.`
+* `Specifies how features are placed on the vertical axis (z). This snippets should be used to set the property "elevationInfo" of a FeatureLayer, CSVLayer, WFSLayer, SceneLayer, StreamLayer, GeoJSONLayer, IntegratedMeshLayer, etc.`
+* `Creates the labelingInfo for labels in a layer for 3D maps. It is normally used in the property "labelingInfo[]" of a FeatureLayer, SceneLayer or any layyer with that property within a SceneView. AMD path: esri/layers/support/LabelClass | ESM path: @arcgis/core/layers/support/LabelClass.js`
> If you want to suggest a change, please [check the issue #21](https://github.com/Esri/arcgis-js-vscode-snippets/issues/21).
### `body`
+Body contain the code snippet that will be inserted:
+
+
+
> If you want to suggest a change, please [check the issue #19](https://github.com/Esri/arcgis-js-vscode-snippets/issues/19).
#### 1) Use `\t` for tabs (do not use spaces)
+> **Note:** You don't have to worry about this if you use the [Snippets Builder](https://esri.github.io/arcgis-js-vscode-snippets/builder/).
+
**Example:**
```js
@@ -105,7 +316,24 @@ Consider using the [snippet builder](https://esri.github.io/arcgis-js-vscode-sni
}
```
-#### 2) Don't add comments in your snippets
+#### 2) Style guide conventions
+
+Follow the ArcGIS Maps SDK for JavaScript coding conventions define in [github.com/esri/jsapi-resources/.prettierrc.json](https://github.com/Esri/jsapi-resources/blob/main/.prettierrc.json):
+
+* **Plain JavaScript**:
+ * Print semicolons at the ends of statements.
+ * Always require parentheses around arrow function arguments ([example](https://eslint.org/docs/latest/rules/arrow-parens)).
+ * Print spaces between brackets in object literals: true ([example](https://prettier.io/docs/en/options.html)).
+ * If at least one property in an object requires quotes, quote all properties.
+ * No [trailing commas](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas) (final commas)
+ * Line length: 120
+* **JavaScript React** (JSX):
+ * Put the \> of a multi-line JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements) ([example](https://prettier.io/docs/en/options.html#deprecated-jsx-brackets)).
+ * Line length: 100
+
+We have set [this prettier.io/playground](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEIA0IIAcYEtoDOyoAhgE5kQDuACuQkSiQDZUkCeRGARmSWAGs4MAMokAtnAAyuKHGQAzFgTg8+g4SKz9ZAc2QwyAV1UgV43AeOmCe5nACKRiPEXLTAKwIAPEXcfOrkhKzCoYAI6BcDSUWIzghLgE8IgYhiS4zHoAwhDi4iTIIFDQ8hi2ULr2AIIwhrjcRvA0cGQycm6hpgAWMOLMAOrduPAE2mBwIgwjuABuI+xFYARcILMmAJJQACYIomBkuDjVOyIw7PadYSBYlCoDfFhFt3AqZLNlILJvMDEkugUrqZtGQ3kVuCRuHBmOgbodYANcNsYN1kABGABMAAYMGQ4JFcHi-gDCsF3GlIYjkaikBiMEYVAAVSGMELXODiKHbXbbKQkSpGf5wABiEDIBTqeiKJCaEBAAF95UA) to help you beautify your code.
+
+#### 3) Don't add comments in your snippets
**Example:**
@@ -116,7 +344,7 @@ myLayer.queryFeatures().then(results => {
})
```
-#### 3) Keep snippets small
+#### 4) Keep snippets small
Try not to instantiate more than one class whenever possible. Keeping snippets small helps make them more reusable. So instead of doing this:
@@ -152,9 +380,10 @@ new MapView({
});
```
-#### 4) Conventions for constructor properties
+#### 5) Conventions for constructor properties
* Sort properties by alphabetical order.
+ * For "JS objects with constructor properties" `type` is an exception. It can be set as the first one.
* Include what you think are the most common properties.
* If a property expects another instance of class, add the name of the snippet (if it exists).
* When a property support multiple value types, add just a placeholder.
@@ -173,7 +402,7 @@ new PopupTemplate({
Observe the [PopupTemplate property "content"](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) include a list of possible values, and `popupContent` will trigger other snippets like:
`popupCustomContent`, `popupMediaContent`, `popupFieldsContent`, `popupTextContent` and `popupAttachmentsContent`.
-#### 5) After a class initialization, don't assign it to a variable
+#### 6) After a class initialization, don't assign it to a variable
Avoid doing this:
@@ -195,7 +424,7 @@ new WebMap({
})
```
-#### 6) For inherited methods, try to make generic snippets.
+#### 7) For inherited methods, try to make generic snippets
For methods like [fromJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#methods-summary), which is inherited in many classes, for example: SimpleRenderer, UniqueValueRenderer, HeatmapRenderer, ... do something like this:
@@ -203,40 +432,16 @@ For methods like [fromJSON()](https://developers.arcgis.com/javascript/latest/ap
${1|Simple,UniqueValue,ClassBreaks,Dictionary,DotDensity,Heatmap|}Renderer.fromJSON(json)
```
-## Commit message format
-
-This project do not strictly follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), but we will use the format `: description [optional #issue-number]` to generate the changelog. Be sure to provide clear and sufficient information in commit messages.
-
-For `` you should use:
-
-* **feat**: A new snippet or feature
-* **fix**: A bug fix with the snippet
-** **docs**: Documentation only changes (changes in markdown)
-* **style**: Changes that do not affect the meaning of the code (conventions, white-space, formatting, missing semi-colons, etc)
-* **refactor**: A code change that neither fixes a bug nor adds a feature
-
-`description`:
-* The subject contains succinct description of the change
-* use the imperative, present tense: "change" not "changed" nor "changes"
-* do not capitalize first letter
-* do not place a period . at the end
-* entire length of the subject must not go over 50 characters
-* describe what the commit does, not what issue it relates to or fixes
-* **be brief, yet descriptive** - we should have a good understanding of what the commit does by reading the subject
+## FAQ
-Examples:
-`style: apply prefix conventions to all snippets #30`
-`doc: update contributing guidelines and minor conventions changes #37`
+**I have made a contribution, but I can't find the contribution in the extension deployed in the marketplace. Why?**
-## Pull request
+The Esri team have to to deploy a new version of the snippet to the Visual Studio Code marketplace in order to make the changes available to every user of the extension.
-Before each PR follow these steps:
+**Can I modify the local installation of the extension to test my edits?**
+To avoid conflicts and overwrites, we do not recommend editing the local installation of your extension placed in your home folder (`~/.vscode/extensions/esri.arcgis-maps-sdk-js-snippets-VERSION_NO`).
-1. Update the file in the [snippets folder](./snippets) (respects the alphabetical order).
-2. Add the info to the [snippets table](./README.md).
-3. Submit your PR.
- * [Link your PR to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if it exists. Use a supported keyword in the pull request description. Ex."`Closes #10`" or "`Fixes Esri/arcgis-js-vscode-snippets#10`".
## Additional resources
diff --git a/README.md b/README.md
index 232a6e3..3e31861 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Visual Studio Code extension that contains a collection of snippets for common c
To use this extension you will need to install:
1. [Visual Studio Code](https://code.visualstudio.com/download) (version 1.35 or higher).
2. The extension. There are two possibilities:
- - From the [Visual Studio Code marketplace](https://marketplace.visualstudio.com/items?itemName=Esri.arcgis-jsapi-snippets).
+ - From the [Visual Studio Code marketplace](https://marketplace.visualstudio.com/items?itemName=Esri.arcgis-maps-sdk-js-snippets).
- Using the ***[Install from VSIX](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix)*** command in Visual Studio Code then import the [arcgis-jsapi-snippets-1.0.0.vsix](./arcgis-jsapi-snippets-1.0.0.vsix) file.
### Usage
@@ -39,12 +39,15 @@ To use this extension you will need to install:
After installing, there are two ways to use it:
**Option 1**) Using [built-in VS Code Intellisense](https://code.visualstudio.com/docs/languages/javascript#_intellisense):
-1. Start typing the prefix for the code snippet.
-2. Select the snippet by pressing `Tab` or `Enter` key.
+1. Create an empty project with an empty `index.js` file.
+2. Start typing one the prefix of one the [available code snippets](#snippets-available). (e.g. `elev`).
+3. Select the snippet by pressing `Tab` or `Enter` key.
+4. If there are values highlighted in gray, you can move between them using `Tab` (forward) and `Shift+Tab` (backwards).
-> **Notes:**
+> **Troubleshooting:**
+> If the Intellisense doesn't work:
> - Make sure to have `"editor.tabCompletion": "on"` in the settings (`Preferences` > `Open Settings(JSON)`)
> - If pressing Tab doesn't work then you might have several snippets with the same prefix. Press `Ctrl-Space` (`Cmd-Space` on mac) to select the one you need.
>
@@ -58,12 +61,6 @@ This extension adds a new option to the activity bar that lets you quickly brows
-### Configuration
-
-If you want to create you own custom snippets you can do so. Read [about User defined snippets in Visual Studio official documentation](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets).
-
-If you do so, please consider [contributing to this repository](#contributing) or join [other developers sharing their snippets](#community-snippets).
-
## Snippets available
### [HTML snippets](snippets/html.json)
@@ -77,38 +74,39 @@ If you do so, please consider [contributing to this repository](#contributing) o
| Prefix | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| require | Load the Map and MapView modules using require |
-| map | Create a map and view. Contains placeholders for the basemap, container, zoom and center |
-| scene | Create a scene and view. Contains placeholders to replace the basemap and the container value. |
-| webmap | Create a map from a WebMap. Contains a placeholder for the portal item id and for the container. |
-| webscene | Create a 3D map from a WebScene. Contains a placeholder for the portal item id and for the container. |
+| require | Load the Map and MapView modules using require
+| requireApiKeys | Load the config, Map and MapView modules using require require |
+| MapViewMap | Create 2D MapView using a Map |
+| SceneViewMap | Create 3D SceneView using a Map. |
+| MapViewWebMap | Create 2D map using a WebMap and a portalItem. |
+| SceneViewWebScene | Create 3D map using a WebScene and a portalItem.. |
| addLayerFromPortalItem | Add a new layer to the map using a portal item id. Contains a placeholder for the portal item id. |
-| simpleRenderer | Generate a simple renderer. Contains a placeholder for the symbol. |
-| uniqueValueRenderer | Generate a unique value renderer. Contains a placeholder for the field, the symbol and it generates a uniqueValueInfos array with placeholers for value, symbol and label for the legend. |
-| classBreaksRenderer | Generate a class breaks renderer. Contains a placeholder for the field, the default symbol and it generates a classBreakInfos array with placeholers for minValue, maxValue, symbol and label for the legend. |
-| sizeVar | Creates a SizeVariable with 2 size stops. The axis property is only used in 3D. It contains placeholders for field, normalizationField, the legend title and the size stop values. |
-| colorVar | Creates a ColorVariable with 2 color stops. It contains placeholders for field, normalizationField, the legend title and the color stop values. |
-| clusterConfig | Generates the configuration for clustering in a MapView. This should be set on layers containing point geometry. |
-| labeling2d | Creates the labelingInfo for labels in a MapView. |
-| labeling3d | Creates the labelingInfo for labels in a SceneView. |
-| simpleMarkerSymbol | Creates a SimpleMarkerSymbol in a MapView. Contains placeholder for style. |
-| pictureMarkerSymbol | Creates a PictureMarkerSymbol in a MapView. |
-| simpleLineSymbol | Creates a SimpleLineSymbol in a MapView. Contains placeholder for style, cap and join. |
-| simpleFillSymbol | Creates a SimpleFillSymbol in a MapView. Contains placeholder for style. |
-| pictureFillSymbol | Creates a PictureFillSymbol in a MapView. |
-| icon | Creates a PointSymbol3D with IconSymbol3DLayer in a SceneView. Contains placeholders for primitive, color and size.. |
-| line | Creates a LineSymbol3D with a LineSymbol3DLayer in a SceneView. Contains placeholders for color and size. |
-| path | Creates a LineSymbol3D with a PathSymbol3DLayer in a SceneView. Contains placeholders for profile, color, width, height, join, cap, anchor and profileRotation. |
-| fill | Creates a PolygonSymbol3D with a FillSymbol3DLayer in a SceneView. Contains placeholders for style, material color and outline color. |
-| water | Creates a PolygonSymbol3D with a WaterSymbol3DLayer in a SceneView. Contains placeholder for waterbodySize and waveStrength. |
-| extrude | Creates a PolygonSymbol3D with an ExtrudeSymbol3DLayer in a SceneView. Contains placeholders for material color and size. |
-| mesh | Creates a MeshSymbol3D with a FillSymbol3DLayer in a SceneView. Contains placeholder for color. |
-| edges | Creates an edges object that can be applied to a FillSymbol3DLayer. Contains placeholders for the type of edges (solid or sketch), the color, the size and the extensionLength. |
-| calloutSmall | Generates the verticalOffset for a city scale level and the callout property. They should be set on PointSymbol3D or LabelSymbol3D. Contains placeholders for size, color and border color. |
-| calloutLarge | Generates the verticalOffset for a globe scale level and the callout property. They should be set on PointSymbol3D or LabelSymbol3D. Contains placeholders for size, color and border color. |
-| elevationInfo | Creates an object for elevationInfo to be set on layers. Contains placeholders for mode, offset, arcade driven expression and unit. |
-| background | Creates an environment object for changing the background of a scene. It should be set on a SceneView and it contains a placeholder for color. |
-| basemapStyle | List all basemap strings |
+| simpleRendererProps | Renders all features in a Layer with one Symbol. This snippet is usually used to set the property \"renderer\" of a FeatureLayer, SceneLayer, MapImageLayer, CSVLayer, GeoJSONLayer, OGCFeatureLayer, WFSLayer, or StreamLayer.. |
+| uniqueValueRendererProps | Generate a unique value renderer. This snippet is usually used to set the property \"renderer\" of a FeatureLayer, SceneLayer, MapImageLayer, CSVLayer, GeoJSONLayer, OGCFeatureLayer, WFSLayer, StreamLayer, ImageryLayer, or ImageryTileLayer |
+| classBreaksRendererProps | Generate a ClassBreaksRenderer. This snippet is usually used to set the property \"renderer\" of a FeatureLayer, SceneLayer, MapImageLayer, CSVLayer, GeoJSONLayer, OGCFeatureLayer, WFSLayer, StreamLayer, ImageryLayer, or ImageryTileLayer. |
+| sizeVisualVariableProps | Set size of features based on a numeric value. Creates a SizeVariable with 2 size stops. The axis property is only used in 3D. This snippet is usually used to set the property \"visualVariables[]\" of a renderer. |
+| colorVarProps | Generate a ColorVariable with 2 color stops. Used to visualize features along a continuous color ramp based on the values of a numeric attribute field or an expression. This snippet is usually used to set the property \"visualVariables[]\" of a renderer class. |
+| featureReductionClusterProps | Generates the configuration for clustering in a MapView. This should be set on layers containing point geometry. This snippet is usually used to set the property \"featureReduction\" of a FeatureLayer, CSVLayer, GeoJSONLayer, WFSLayer, or OGCFeatureLayer geometry. |
+| LabelClass2D | Creates the labelingInfo for labels in a layer for 2D maps. It in normally used in the property \"labelingInfo[]\" of a FeatureLayer, CSVLayer, GeoJSONLayer, StreamLayer, OGCFeatureLayer, or WFSLayer in 2D MapViews. |
+| LabelClass3D | Creates the labelingInfo for labels in a layer for 3D maps. It is normally used in the property \"labelingInfo[]\" of a FeatureLayer, SceneLayer or any layyer with that property within a SceneView. |
+| simpleMarkerSymbolProps | Create a SimpleMarkerSymbol for rendering 2D Point geometries with a simple shape and color in either a MapView or a SceneView, but for 3D it is recommended to use PointSymbol3D. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.. |
+| pictureMarkerSymbolProps | Create a PictureMarkerSymbol, allowing custom image-based markers for points on maps. |
+| simpleLineSymbolProps | Create a SimpleLineSymbol for rendering 2D polyline geometries in a 2D or 3D view, but for 3D it is recommended to use LineSymbol3D. It can be used in several properties like \"symbol\" of renderers or individual graphics, but also \"outline\" of marker and fill symbols. |
+| simpleFillSymbolProps | Create a SimpleFillSymbol for rendering 2D polygon geometries in a 2D or 3D view, but for 3D it is recommended to use PolygonSymbol3D. It can be filled with a solid color, or a pattern. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.. |
+| pictureFillSymbolProps | CPictureFillSymbol uses an image in a repeating pattern to symbolize polygon features in a 2D MapView. patterns for polygons. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. |
+| pointSymbol3dIconProps | Generate PointSymbol3D with a IconSymbol3DLayer in a SceneView. Available shapes: circle, square, cross, x, kite, and triangle. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. |
+| lineSymbol3DProps | Generate LineSymbol3D with a LineSymbol3DLayer in a SceneView. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. |
+| lineSymbol3DPathProps | Generate LineSymbol3D with a PathSymbol3DLayer. Renders Polyline geometries by extruding a 2D profile along the line. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. |
+| meshSymbol3DProps | Generate MeshSymbol3D with a FillSymbol3DLayer in a SceneLayer in a SceneView. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. |
+| waterSymbol3dLayerProps | WaterSymbol3DLayer is used to render Polygon geometries as realistic, animated water surfaces, therefore it can only be used inside a PolygonSymbol3D. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. |
+| polygonSymbol3DExtrudeProps | Generate PolygonSymbol3D with a ExtrudeSymbol3DLayer to be used in a SceneView. It render polygon geometries by extruding them upward from the ground, creating a 3D volumetric object. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics. | |
+| edges3DProps | Add edge rendering visualization to existing symbols. Can only be applied to \"edges\" property of FillSymbol3DLayer on MeshSymbol3D or ExtrudeSymbol3DLayer on PolygonSymbol3D. |
+| callout3DSmallProps | Generates a Callout3D with a verticalOffset for a city scale level and the callout property. They should be set on the property \"callout\" of PointSymbol3D or LabelSymbol3D. |
+| callout3DLargeProps | Generates a Callout3D with a verticalOffset for a world scale level and the callout property. They should be set on the property \"callout\" of PointSymbol3D or LabelSymbol3D. |
+| elevationInfoProps | Specifies how features are placed on the vertical axis (z). This snippets should be used to set the property \"elevationInfo\" of a FeatureLayer, CSVLayer, WFSLayer, SceneLayer, StreamLayer, GeoJSONLayer, IntegratedMeshLayer, etc. |
+| sceneViewEnvironmentProps | Creates an environment object for changing the background of a scene. This snippet is usually used to set the property \"environment\" of the SceneView. |
+| basemapsWithAPIKeys | List all available map styles to be used without API keys. Use of these basemaps requires an ArcGIS Developer subscription or a valid ArcGIS Online organizational subscription |
+| basemapsWithoutAPIKeys | List all available map styles to be used without API keys. Use of these basemaps requires an ArcGIS Developer subscription or a valid ArcGIS Online organizational subscription |
### [TypeScript snippets](snippets/typescript.json)
@@ -172,14 +170,18 @@ If you do so, please consider [contributing to this repository](#contributing) o
## Issues
-If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-js-vscode-snippets/issues/) first. Have you found a new bug? Want to request a new feature? [Open a new issue](https://github.com/Esri/arcgis-js-vscode-snippets/issues/), we'd love to hear from you.
-
-If you're looking for help you can also post issues on Stack Overflow with the "[**esri-oss**](https://stackoverflow.com/questions/tagged/esri-oss)" tag.
+If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-js-vscode-snippets/issues/) first. Have you found a new bug? Want to request an enhancement to an existing snippet? Suggest a new snippet or tool? [Open a new issue](https://github.com/Esri/arcgis-js-vscode-snippets/issues/new/choose), we'd love to hear from you.
## Contributing
Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](./CONTRIBUTING.md).
+### Additional resources
+
+To learn more about **general use of code snippets in Visual Studio Code** read [Visual Studio official documentation](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets).
+
+If you create your own custom code snippets to work with the ArcGIS Maps SDK for JavaScript, please consider [contributing to this repository](#contributing) or join [other developers sharing their snippets](#community-snippets).
+
## License
Copyright 2023 Esri
diff --git a/builder/index.html b/builder/index.html
index d7c7f2b..f152df4 100644
--- a/builder/index.html
+++ b/builder/index.html
@@ -40,7 +40,7 @@
Custom Snippet
Prefix *
+ >Prefix*Custom Snippet
Prefix
Defines one or more trigger words that display the
- snippet in IntelliSense. Substring matching is performed on
- prefixes, so in this case, "fc" could match "for-const".
+ snippet in IntelliSense. Approximate string matching (fuzzy search) is performed on
+ prefixes, so in this case, "fl" could match "FeatureLayer".
- Recomendations
+ Recommendations
Good prefixes are short and easy to remember, so you can
include the name of the method, class or property. Avoid
- using just acronyms.
+ using just acronyms. E.g. MapView, basemapsWithAPIKeys, findLayerByTitle, popupTemplateProps.
@@ -74,7 +74,7 @@
Custom Snippet
- Name *
+ Name*Custom Snippet
Short description that follows the prefix.
- Recomendations
- To differentiate from other IntelliSense we recommend you to
- include (Esri JSAPI)
+ Recommendations
+ Use plain English, using spaces as needed (length <35 characters). E.g. "Find layer in a MapView by title"
@@ -118,8 +117,8 @@
Custom Snippet
IntelliSense.
- Recomendations
- Explain of what the snippet does, but keep it short.
+ Recommendations
+ Explain of what the snippet does. Reuse text from the API reference whenever possible. Add AMD and ESM paths if it is a class initialization (new ...)
@@ -131,11 +130,11 @@
Custom Snippet
>
-
+
- Body *
+ Body* (Prettier playground)
Custom Snippet
which the snippet is inserted.
- Recomendations
+ Recommendations
Use "Placeholders" (${1:foo}) and "Choices" (${1|value1,value2}) when possible.
diff --git a/dev/README.md b/dev/README.md
new file mode 100644
index 0000000..c6128e8
--- /dev/null
+++ b/dev/README.md
@@ -0,0 +1,110 @@
+# Development environment
+
+To contribute without messing around with other snippets you might use in other projects, this repo provides a project-folder scoped file (`development.code-snippets`) and several playgrounds to help you test the snippets you are going to contribute.
+
+
+
+**Table of Contents**:
+
+- [Getting started](#getting-started)
+ - [Add a new snippet](#add-a-new-snippet)
+ - [Enhance an existing snippet](#enhance-an-existing-snippet)
+ - [Test a snippet](#test-a-snippet)
+- [Troubleshooting](#troubleshooting)
+- [FAQ](#faq)
+ - [How do I add placeholders to my snippet?](#how-do-i-add-placeholders-to-my-snippet)
+ - [How do I add a dropdown/choices in my snippet?](#how-do-i-add-a-dropdownchoices-in-my-snippet)
+ - [Are there other alternatives to use the `development.code-snippets` file?](#are-there-other-alternatives-to-use-the-developmentcode-snippets-file)
+ - [Are there other alternatives to use the Snippet Builder to generate JSON code?](#are-there-other-alternatives-to-use-the-snippet-builder-to-generate-json-code)
+- [Additional resources](#additional-resources)
+
+
+
+## Getting started
+
+First of all, **fork and clone locally** this repository.
+
+### Add a new snippet
+
+* 1\) Within this folder ([dev](./dev)), build a sample app make sure you have tested the code snippet you want to contribute (e.g. [sample-app.html](./sample-app.html)).
+* 2\) Generate the [custom snippet code](#what-is-a-custom-snippet-code) using the [VS Code Snippets Builder](https://esri.github.io/arcgis-js-vscode-snippets/builder/).
+* 3\) Paste your VS Code Snippets JSON syntax into [../.vscode/development.code-snippets](../.vscode/development.code-snippets).
+* 4\) [Test the snippet](#test-a-snippet)
+
+
+### Enhance an existing snippet
+
+To be able to test your modifications, we encourage you to follow these steps, even if you are doing a simple change to the `prefix`, `name`, or `description`.
+
+* 1\) Open the file (from the [snippets folder](../snippets/)) that contains the [custom snippet code](#what-is-a-custom-snippet-code) you are going to enhance, **find it and copy it**.
+* 2\) Paste the snippet into [../.vscode/development.code-snippets](../.vscode/development.code-snippets).
+* 3\) Do the modifications there. Use the [snippets builder](https://esri.github.io/arcgis-js-vscode-snippets/builder/), and add [placeholders](#are-there-other-alternatives-to-use-the-developmentcode-snippets-file), [choices](#how-do-i-add-a-dropdownchoices-in-my-snippet), ... as needed.
+* 4\) [Test the snippet](#test-a-snippet)
+
+### Test a snippet
+
+* 1\) Open in VS Code a file and start typing your snippet prefix. You can use any of the provided files within the folder [playgrounds](./playgrounds/) to test it. Choose the right one based on the type of snippets you want to contribute:
+ * **index.html** for HTML, CSS and JavaScript snippets.
+ * **config.json** or **data.geojson** for JSON snippets.
+ * **index.ts** for TypeScript snippets.
+ * **index.tsx** for TypeScript React snippets.
+* 2\) If everything works as expected, follow the [steps to add your changes](https://github.com/Esri/arcgis-js-vscode-snippets/blob/master/CONTRIBUTING.md#add-your-changes).
+
+
+## Troubleshooting
+
+If your code snippet doesn't show up:
+* Make sure the developmnet.code-snippets is still a valid JSON. You can test it with [JSONLint](http://jsonlint.com/) (but **remember to remove comments**).
+* Use the command palette (Mac: `Cmd + Shift + P` | Windows/Linux: `Ctrl + Shift + P`) and type Developer: `Reload Window`.
+
+## FAQ
+
+### How do I add placeholders to my snippet?
+
+You have to use the syntax `${1:default_value}`. Example:
+
+```json
+{
+ "Load a new MapView (2D)": {
+ "prefix": "mapView",
+ "body": [
+ "new MapView({",
+ "\tcontainer: \"${1:viewDiv}\",",
+ "\tmap: ${2:map},",
+ "});"
+ ]
+ },
+}
+```
+Learn [more about placeholders](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_placeholders).
+
+### How do I add a dropdown/choices in my snippet?
+
+You have to use the syntax `${1|one,two,three|}`. Example:
+
+```json
+ "Get the API from the CDN": {
+ "prefix": "getApi",
+ "body": [
+ "",
+ ""
+ ],
+ },
+```
+
+Learn [more about choices](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_choice).
+
+### Are there other alternatives to use the `development.code-snippets` file?
+1. In VSCode show command palette pressing: `Cmd + Shift + P` (Windows: `Ctrl + Shift + P`) then type/select `Preferences: Configure User Snippets`.
+2. Select your preferred option, `New Global Snippets file...` or the folder you want to place the snippets file.
+
+### Are there other alternatives to use the Snippet Builder to generate JSON code?
+Yes, you can use any another extension, for example, the [Snippet Generator](https://marketplace.visualstudio.com/items?itemName=wenfangdu.snippet-generator).
+
+## Additional resources
+
+Learn more about:
+* [VS Code Snippets JSON syntax](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax)
+* [Snippets scope (language and project scopes)](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-scope)
+
+
diff --git a/dev/playgrounds/config.json b/dev/playgrounds/config.json
new file mode 100644
index 0000000..50fddb5
--- /dev/null
+++ b/dev/playgrounds/config.json
@@ -0,0 +1,2 @@
+// Test your JSON snippets here (e.g. featureCollectionPoint)
+// Note: Remove this comments afterwards (JSON do not support comments)
diff --git a/dev/playgrounds/data.geojson b/dev/playgrounds/data.geojson
new file mode 100644
index 0000000..68e2b2f
--- /dev/null
+++ b/dev/playgrounds/data.geojson
@@ -0,0 +1,2 @@
+// Test your JSON snippets here (e.g. featureCollectionPoint)
+// Note: Remove this comments afterwards (GeoJSON do not support comments)
diff --git a/dev/playgrounds/index.html b/dev/playgrounds/index.html
new file mode 100644
index 0000000..5209fd7
--- /dev/null
+++ b/dev/playgrounds/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ Development environment
+
+
+
+
+
+
+
+
diff --git a/dev/playgrounds/index.ts b/dev/playgrounds/index.ts
new file mode 100644
index 0000000..fe2fea3
--- /dev/null
+++ b/dev/playgrounds/index.ts
@@ -0,0 +1 @@
+// Test your TypeScript here (e.g. myDebug)
diff --git a/dev/playgrounds/index.tsx b/dev/playgrounds/index.tsx
new file mode 100644
index 0000000..9fe6253
--- /dev/null
+++ b/dev/playgrounds/index.tsx
@@ -0,0 +1 @@
+// Test your TypeScript React here (e.g. helloWorldTSX)
\ No newline at end of file
diff --git a/dev/playgrounds/main.scss b/dev/playgrounds/main.scss
new file mode 100644
index 0000000..7265696
--- /dev/null
+++ b/dev/playgrounds/main.scss
@@ -0,0 +1 @@
+// Test your JavaScript snippets here (e.g. smallMap)
\ No newline at end of file
diff --git a/dev/sample-app.html b/dev/sample-app.html
new file mode 100644
index 0000000..2f94457
--- /dev/null
+++ b/dev/sample-app.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
diff --git a/images/places-and-choices.png b/images/places-and-choices.png
new file mode 100644
index 0000000..8c71bb5
Binary files /dev/null and b/images/places-and-choices.png differ
diff --git a/images/vscode-intelisense-components.png b/images/vscode-intelisense-components.png
new file mode 100644
index 0000000..c24f36f
Binary files /dev/null and b/images/vscode-intelisense-components.png differ
diff --git a/snippets/html.json b/snippets/html.json
index 2448b81..c146646 100644
--- a/snippets/html.json
+++ b/snippets/html.json
@@ -22,15 +22,6 @@
""
],
"description": "Sets /app folder to be able to load packages using require([\"app/your_file.js\"]);"
- },
- "Get Calcite": {
- "prefix": "calcite",
- "body": [
- "",
- "",
- ""
- ],
- "description": "Get Calcite library"
}
}
diff --git a/snippets/scss.json b/snippets/scss.json
deleted file mode 100644
index d19ee55..0000000
--- a/snippets/scss.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "Full Map": {
- "prefix": "fmap-sass",
- "body": [
- "html, body, #viewDiv{",
- "padding:0;",
- "margin:0;",
- "height:100%;",
- "width:100%;}"
- ],
- "description": "Full Map CSS"
- }
-}
\ No newline at end of file