Skip to content

Commit 51ad16e

Browse files
Updated flow-bin to 0.68.0, trying to resolve #41
1 parent c25991a commit 51ad16e

File tree

8 files changed

+144
-16
lines changed

8 files changed

+144
-16
lines changed

changelog/0.16.11.txt

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
v0.16.11
2+
3+
## Fixes
4+
5+
- Trying to fix #41
6+
7+
## Improvements
8+
- Updated flow-bin to 0.68.0
9+
10+
v0.16.0
11+
12+
## Fixes
13+
14+
- Fixed jsdoc generate command
15+
- Fixed error on refactor safe commands when the file name is empty
16+
- Fixed export refactor feature preview
17+
- Fixed some popup colors with different theme color scheme
18+
- Fixed completions and hover_description that starts with "$"
19+
- Fixed issue #36, keymap of next flow error feature changed from "super+alt+c" to "super+alt+b"
20+
21+
## Improvements
22+
23+
- Complete code plugin refactoring
24+
- Improved completions performance using 'flow ide' command
25+
- Added "code screenshot" feature using [carbon](https://carbon.now.sh/)
26+
- updated flow-bin to 0.67.1
27+
- Added initial support for Vue.js (see https://github.com/pichillilorenzo/JavaScriptEnhancements/wiki/Example-Vue.js-project)
28+
- Improved extract method feature
29+
- Improved completions detection from default_autocomplete.json
30+
- Added Flow warnings
31+
- Improved unused variable feature
32+
33+
## Misc
34+
- Changed gutter color (using other available sublime scopes) for errors and unused variable features.
35+
36+
=================================================================
37+
** THIS PLUGIN IS IN BETA! Thanks for your support in advance! **
38+
=================================================================
39+
40+
If you like it, remember to star it ⭐ on GitHub: https://github.com/pichillilorenzo/JavaScriptEnhancements
41+
42+
** USAGE **
43+
===========
44+
45+
See how it works on the Wiki: 👉👉 https://github.com/pichillilorenzo/JavaScriptEnhancements/wiki 👈👈
46+
47+
48+
** WHAT IS THIS? **
49+
===================
50+
51+
This plugin uses Flow (javascript static type checker from Facebook) under the hood.
52+
53+
It offers better javascript autocomplete and a lot of features about creating,
54+
developing and managing javascript projects, such as:
55+
56+
- Cordova projects (run cordova emulate, build, compile, serve, etc. directly from Sublime Text!)
57+
- Ionic v1 and v2 (it includes also v3) projects (same as Cordova projects!)
58+
- Angular v1 and v2 (it includes also v4 and v5) projects
59+
- Vue projects (only about the creation at this moment, see https://github.com/pichillilorenzo/JavaScriptEnhancements/wiki/Example-Vue.js-project)
60+
- React projects (only about the creation at this moment)
61+
- React Native projects (only about the creation at this moment. I will add also NativeScript support)
62+
- Express projects (only about the creation at this moment)
63+
- Yeoman generators
64+
- Local bookmarks project
65+
- JavaScript real-time errors
66+
- Code Refactoring
67+
- etc.
68+
69+
You could use it also in existing projects (see the Wiki - https://github.com/pichillilorenzo/JavaScriptEnhancements/wiki/Using-it-with-an-existing-project)!
70+
71+
It turns Sublime Text into a JavaScript IDE like!
72+
73+
This project is based on my other Sublime Text plugin JavaScript Completions (https://github.com/pichillilorenzo/JavaScript-Completions)
74+
75+
** NOTE **
76+
If you want use this plugin, you may want uninstall/disable the JavaScript Completions plugin, if installed.
77+
78+
** OS SUPPORTED **
79+
==================
80+
81+
👉 Linux (64-bit)
82+
👉 Mac OS X
83+
👉 Windows (64-bit): released without the use of TerminalView plugin. For each feature (like also creating a project) will be used the cmd.exe shell (so during the creation of a project don't close it until it finishes!). Unfortunately the TerminalView plugin supports only Linux-based OS 😞. Has someone any advice or idea about that? Is there something similar to the TerminalView plugin for Windows?? Thanks!
84+
85+
❗❗ Dependencies ❗❗
86+
=======================
87+
88+
In order to work properly, this plugin has some dependencies:
89+
90+
👉 Sublime Text 3 (build 3124 or newer)
91+
👉 Node.js and npm (https://nodejs.org or nvm (https://github.com/creationix/nvm))
92+
👉 TerminalView (only for Linux and Mac OS X) sublime text plugin (https://github.com/Wramberg/TerminalView)
93+
94+
Not required, but useful for typescript files (Flow wont work on this type of files):
95+
96+
👉 TypeScript sublime text plugin (https://github.com/Microsoft/TypeScript-Sublime-Plugin)
97+
98+
** Flow Requirements **
99+
=======================
100+
101+
It use [Flow](https://github.com/facebook/flow) for type checking and auto-completions.
102+
103+
👉 Mac OS X
104+
👉 Linux (64-bit)
105+
👉 Windows (64-bit)
106+
107+
Email me for any questions or doubts about this new project on: [email protected]
108+
109+
** Donation **
110+
==============
111+
112+
If this project help you reduce time to develop and also you like it, please support it with a donation 😄👍. Thanks!
113+
114+
Open Collective: https://opencollective.com/javascriptenhancements/donate
115+
PayPal: https://www.paypal.me/LorenzoPichilli
116+
117+
Thanks anyway for your support! 😄😄
118+
119+
MIT License

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def start():
8484
print(result)
8585
if os.path.exists(node_modules_path):
8686
shutil.rmtree(node_modules_path)
87-
sublime.error_message("Error during installation: can't install npm dependencies for JavaScript Enhancements plugin.\n\nThe error COULD be caused by the npm permission access (EACCES error), so in this case you need to repair/install node.js and npm in a way that doesn't require \"sudo\" command.\n\nFor example you could use a Node Version Manager, such as \"nvm\" or \"nodenv\".\n\nTry to run \"npm install\" inside the package of this plugin to see what you get.")
87+
sublime.error_message("Error during installation: can't install npm dependencies for JavaScript Enhancements plugin.\n\nThe error COULD be caused by the npm permission access (EACCES error), so in this case you need to repair/install node.js and npm in a way that doesn't require \"sudo\" command.\n\nFor example you could use a Node Version Manager, such as \"nvm\" or \"nodenv\".\n\nTry to run \"npm install\" inside the package of this plugin to see what you get.\n\nRemember to open an issue on GitHub!")
8888
return
8989

9090
Hook.apply('plugin_ready')

messages.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"0.13.17": "changelog/0.13.17.txt",
2121
"0.15.0": "changelog/0.15.0.txt",
2222
"0.16.0": "changelog/0.16.0.txt",
23-
"0.16.1": "changelog/0.16.1.txt"
23+
"0.16.1": "changelog/0.16.1.txt",
24+
"0.16.11": "changelog/0.16.11.txt"
2425
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"flow-bin": "0.67.1",
3+
"flow-bin": "0.68.0",
44
"flow-remove-types": "1.2.3",
55
"flow-typed": "2.2.3",
66
"jsdoc": "3.5.5"

src/commands/can_i_use/can_i_use_data.json

+1-1
Large diffs are not rendered by default.

src/commands/carbon.py

+3
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ def run(self, edit, **args):
104104
language = javaScriptEnhancements.get('carbon_language')
105105

106106
if not language:
107+
# get current view syntax
107108
syntax = os.path.splitext(os.path.basename(view.settings().get("syntax")))[0]
108109
if syntax in LANGUAGE_MAPPING:
110+
# set language from the mapping
109111
language = LANGUAGE_MAPPING[syntax]
110112
else:
113+
# otherwise set 'auto': Carbon will try to understand which language is used.
111114
language = 'auto'
112115

113116
query = {

src/libs/flow/flow_ide_server.py

+16-11
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def start_stdio_server(self, on_receive, on_closed, options = []):
3232

3333
args = flow_path + ["ide", "--protocol", "very-unstable", "--from", "sublime_text"] + options + ["--root", self.root]
3434
print("starting flow ide server: " + str(args))
35+
sublime.status_message('Starting flow ide server, root: ' + self.root)
3536

3637
try:
3738
self.process = subprocess.Popen(
@@ -69,8 +70,7 @@ def stop(self):
6970

7071
def prepare_json_rpc_message(self, json_rpc):
7172
json_rpc = json.dumps(json_rpc)
72-
message = """
73-
Content-Length: """ + str(len(json_rpc) + 1) + """
73+
message = """Content-Length: """ + str(len(json_rpc) + 1) + """
7474
7575
""" + json_rpc + """
7676
"""
@@ -129,25 +129,30 @@ def read_stdout(self):
129129

130130
if (content_length > 0):
131131
content = self.process.stdout.read(content_length)
132-
133132
self.on_receive(content.decode("UTF-8"))
134133

135134
except IOError as err:
136135
self.close()
137136
print("Failure reading stdout", err)
138137
break
139138

140-
print("flow ide stdout process ended.")
139+
print("flow ide stdout process ended. Possible errors:")
140+
# print possible errors
141+
error = self.process.stderr.readline()
142+
while error:
143+
print(error.decode("UTF-8").strip())
144+
error = self.process.stderr.readline()
145+
141146
self.close()
142147

143148
def send(self, message):
144-
if self.process:
145-
try:
146-
self.process.stdin.write(bytes(message, 'UTF-8'))
147-
self.process.stdin.flush()
148-
except (BrokenPipeError, OSError) as err:
149-
print("Failure writing to stdout", err)
150-
self.close()
149+
if self.process:
150+
try:
151+
self.process.stdin.write(bytes(message, 'UTF-8'))
152+
self.process.stdin.flush()
153+
except (BrokenPipeError, OSError) as err:
154+
print("Failure writing to flow ide stdout", err)
155+
self.close()
151156

152157
class JavascriptEnhancementsStartFlowIDEServerEventListener(sublime_plugin.EventListener):
153158

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"id": "tools", "children": [{"id": "npm_scripts", "children": [], "caption": "Npm/Yarn Scripts"}], "caption": "Tools"}]
1+
[{"children": [{"children": [], "caption": "Npm/Yarn Scripts", "id": "npm_scripts"}], "caption": "Tools", "id": "tools"}]

0 commit comments

Comments
 (0)