Skip to content

Commit

Permalink
Fix .js file activation issue (#15)
Browse files Browse the repository at this point in the history
* Update for flow 0.25

(1) update dependence
(2) change language activation to `javascript`, use `javascript` instead of the fake `flow` language
(3) small fixs in `launch.json`, `.gitignore`

* change version to 0.0.3

* fix known issue and setup steps
  • Loading branch information
frogcjn authored and nmote committed May 25, 2016
1 parent 71ded7a commit f545d81
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
build
node_modules
npm-debug.log**
npm-debug.log**
.DS_Store
2 changes: 1 addition & 1 deletion .vscode/launch.json
Expand Up @@ -10,7 +10,7 @@
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "build"
"outDir": "${workspaceRoot}/build"
}
]
}
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -11,6 +11,7 @@ Follow the [instructions](https://code.visualstudio.com/docs/editor/extension-ga
* Flow is only supported on Mac and Linux, follow [flowtype.org](http://flowtype.org/docs/getting-started.html#_) to get started
* You need a `.flowconfig` in your workspace to enable the flow features
* Make sure you are able to run the `flow` command from the command line
* Set workspace preference with `"javascript.validate.syntaxValidation": false`.

## Features

Expand All @@ -21,7 +22,7 @@ Follow the [instructions](https://code.visualstudio.com/docs/editor/extension-ga

## Known Issues

* when you create a new file and add the `/* @flow */` to the beginning you need to manually change the mode from the status bar to `Flow`
* You should set workspace preference to disable default syntax validation from Visual Studio Code: `"javascript.validate.syntaxValidation": false`.

## About

Expand Down
2 changes: 1 addition & 1 deletion lib/flowMain.js
Expand Up @@ -9,7 +9,7 @@
*/

// Necessary to get the regenerator runtime, which transpiled async functions need
import * as _ from 'regenerator/runtime';
import * as _ from 'regenerator-runtime/runtime';

import * as vscode from 'vscode';

Expand Down
32 changes: 8 additions & 24 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "flow-for-vscode",
"version": "0.0.2",
"version": "0.0.3",
"publisher": "flowtype",
"description": "Flow support for VS Code",
"displayName": "Flow Language Support",
Expand All @@ -13,50 +13,34 @@
],
"private": true,
"activationEvents": [
"onLanguage:flow"
"onLanguage:javascript"
],
"main": "./build/flowMain",
"contributes": {
"languages": [
{
"id": "flow",
"firstLine": "^\\/\\* @flow \\*\\/$",
"aliases": [
"Flow"
]
},
{
"id": "flow",
"firstLine": "^[\"|']use babel[\"|'];$",
"aliases": [
"Flow"
]
}
],
"grammars": [{
"language": "flow",
"language": "javascript",
"scopeName": "source.js.jsx",
"path": "./syntaxes/Babel Language.json"
}, {
"scopeName": "source.regexp.babel",
"path": "./syntaxes/Babel Regex.json"
}],
"snippets": [{
"language": "flow",
"language": "javascript",
"path": "./snippets/flow.json"
}],
"debuggers": [{
"type": "extensionHost",
"enableBreakpointsFor": {
"languageIds": [
"flow"
"javascript"
]
}
},{
"type": "node",
"enableBreakpointsFor": {
"languageIds": [
"flow"
"javascript"
]
}
}]
Expand All @@ -66,8 +50,8 @@
"compile": "./compile.sh --watch"
},
"dependencies": {
"nuclide-flow-base": "0.0.34",
"regenerator": "^0.8.42"
"nuclide-flow-base": "0.0.35",
"regenerator-runtime": "^0.9.5"
},
"devDependencies": {
"vscode": "0.10.x",
Expand Down

0 comments on commit f545d81

Please sign in to comment.