Skip to content

Commit 4c218be

Browse files
committed
Add config options supported in pyls 0.17
This also improves the overall config layout in the setting view
1 parent 18b5a57 commit 4c218be

File tree

2 files changed

+118
-28
lines changed

2 files changed

+118
-28
lines changed

lib/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class PythonLanguageClient extends AutoLanguageClient {
2828
return {
2929
pyls: {
3030
configurationSources: configuration.pylsConfigurationSources,
31+
rope: configuration.ropeFolder,
3132
plugins: configuration.pylsPlugins
3233
}
3334
};

package.json

Lines changed: 117 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
"ide",
88
"python",
99
"atom-ide",
10-
"languageserver",
11-
"language-server-protocol",
12-
"language-client",
1310
"autocomplete",
1411
"jedi",
1512
"rope",
1613
"pyflakes",
1714
"pycodestyle",
1815
"pydocstyle",
16+
"autopep8",
1917
"yapf",
20-
"mccabe"
18+
"mccabe",
19+
"languageserver",
20+
"language-server-protocol",
21+
"language-client"
2122
],
2223
"repository": "https://github.com/lgeiger/ide-python",
2324
"license": "MIT",
@@ -27,9 +28,7 @@
2728
"dependencies": {
2829
"atom-languageclient": "^0.9.1"
2930
},
30-
"enhancedScopes": [
31-
"source.python"
32-
],
31+
"enhancedScopes": ["source.python"],
3332
"configSchema": {
3433
"pylsPath": {
3534
"title": "Python Language Server Path",
@@ -39,19 +38,22 @@
3938
"description": "Absolute path to `pyls` executable."
4039
},
4140
"pylsConfigurationSources": {
41+
"order": 2,
4242
"type": "array",
43-
"default": [
44-
"pycodestyle"
45-
],
43+
"default": ["pycodestyle", "flake8"],
4644
"description": "List of configuration sources to use. Requires `pyls` 0.12.1+",
4745
"items": {
4846
"type": "string",
49-
"enum": [
50-
"pycodestyle",
51-
"flake8"
52-
]
47+
"enum": ["pycodestyle", "flake8"]
5348
}
5449
},
50+
"ropeFolder": {
51+
"order": 3,
52+
"type": ["string", null],
53+
"default": ".ropeproject",
54+
"description":
55+
"The name of the folder in which rope stores project configurations and data. If empty, no such a folder is used at all. Requires `pyls` 0.17+"
56+
},
5557
"pylsPlugins": {
5658
"title": "Python Language Server Plugins",
5759
"type": "object",
@@ -131,7 +133,8 @@
131133
"title": "All Scopes",
132134
"type": "boolean",
133135
"default": true,
134-
"description": "If enabled lists the names of all scopes instead of only the module namespace. Requires `pyls` 0.7.0+"
136+
"description":
137+
"If enabled lists the names of all scopes instead of only the module namespace. Requires `pyls` 0.7+"
135138
}
136139
}
137140
},
@@ -149,7 +152,8 @@
149152
"title": "Threshold",
150153
"type": "number",
151154
"default": 15,
152-
"description": "The minimum threshold that triggers warnings about cyclomatic complexity."
155+
"description":
156+
"The minimum threshold that triggers warnings about cyclomatic complexity."
153157
}
154158
}
155159
},
@@ -158,41 +162,43 @@
158162
"type": "object",
159163
"properties": {
160164
"enabled": {
165+
"order": 1,
161166
"title": "Enabled",
162167
"type": "boolean",
163168
"default": true,
164169
"description": "Enable or disable PyCodeStyle."
165170
},
166171
"select": {
172+
"order": 2,
173+
"title": "Select",
167174
"type": "array",
168-
"default": [],
169175
"items": {
170176
"type": "string"
171177
},
178+
"default": [],
172179
"description": "Select errors and warnings. Requires `pyls` 0.14+"
173180
},
174181
"ignore": {
182+
"order": 3,
183+
"title": "Ignore",
175184
"type": "array",
176-
"default": [
177-
"E121",
178-
"E123",
179-
"E126",
180-
"E226",
181-
"E24",
182-
"E704",
183-
"W503"
184-
],
185+
"default": ["E121", "E123", "E126", "E226", "E24", "E704", "W503"],
185186
"items": {
186187
"type": "string"
187188
},
188189
"description": "Ignore errors and warnings. Requires `pyls` 0.14+"
189190
},
190191
"hangClosing": {
192+
"order": 4,
193+
"title": "Hang Closing",
191194
"type": "boolean",
192195
"default": false,
193-
"description": "Hang closing bracket instead of matching indentation of opening bracket's line. Requires `pyls` 0.12.1+"
196+
"description":
197+
"Hang closing bracket instead of matching indentation of opening bracket's line. Requires `pyls` 0.12.1+"
194198
},
195199
"maxLineLength": {
200+
"order": 5,
201+
"title": "Max Line Length",
196202
"type": "number",
197203
"default": 79,
198204
"description": "Set maximum allowed line length. Requires `pyls` 0.12.1+"
@@ -204,10 +210,78 @@
204210
"type": "object",
205211
"properties": {
206212
"enabled": {
213+
"order": 1,
207214
"title": "Enabled",
208215
"type": "boolean",
209216
"default": false,
210217
"description": "Enable or disable PyDocStyle."
218+
},
219+
"match": {
220+
"order": 2,
221+
"title": "Match",
222+
"type": "string",
223+
"default": "(?!test_).*\\.py",
224+
"description":
225+
"Check only files that exactly match the given regular expression; default is to match files that don't start with 'test_' but end with '.py'. Requires `pyls` 0.17+"
226+
},
227+
"matchDir": {
228+
"order": 3,
229+
"title": "Match Dir",
230+
"type": "string",
231+
"default": "[^\\.].*",
232+
"description":
233+
"Search only dirs that exactly match the given regular expression; default is to match dirs which do not begin with a dot. Requires `pyls` 0.17+"
234+
},
235+
"select": {
236+
"order": 4,
237+
"title": "Select",
238+
"type": "array",
239+
"default": [],
240+
"items": {
241+
"type": "string"
242+
},
243+
"description": "Select errors and warnings Requires `pyls` 0.17+"
244+
},
245+
"ignore": {
246+
"order": 5,
247+
"title": "Ignore",
248+
"type": "array",
249+
"default": [],
250+
"items": {
251+
"type": "string"
252+
},
253+
"description": "Ignore errors and warnings Requires `pyls` 0.17+"
254+
},
255+
"convention": {
256+
"order": 6,
257+
"title": "Convention",
258+
"type": "string",
259+
"enum": ["pep257", "numpy", ""],
260+
"default": "",
261+
"description":
262+
"Choose the basic list of checked errors by specifying an existing convention. Requires `pyls` 0.17+"
263+
},
264+
"addSelect": {
265+
"order": 7,
266+
"title": "Add Select",
267+
"type": "array",
268+
"default": [],
269+
"items": {
270+
"type": "string"
271+
},
272+
"description":
273+
"Select errors and warnings in addition to the specified convention. Requires `pyls` 0.17+"
274+
},
275+
"addIgnore": {
276+
"order": 8,
277+
"title": "Add Ignore",
278+
"type": "array",
279+
"default": [],
280+
"items": {
281+
"type": "string"
282+
},
283+
"description":
284+
"Ignore errors and warnings in addition to the specified convention. Requires `pyls` 0.17+"
211285
}
212286
}
213287
},
@@ -228,6 +302,7 @@
228302
"type": "object",
229303
"properties": {
230304
"enabled": {
305+
"title": "Enabled",
231306
"type": "boolean",
232307
"default": false,
233308
"description": "Enable or disable the plugin. Requires `pyls` 0.12.1+"
@@ -237,12 +312,26 @@
237312
"yapf": {
238313
"title": "Yapf",
239314
"type": "object",
315+
"properties": {
316+
"enabled": {
317+
"title": "Enabled",
318+
"type": "boolean",
319+
"default": false,
320+
"description":
321+
"Enable or disable Yapf. If both Yapf and autopep8 are enabled the latter is prefered."
322+
}
323+
}
324+
},
325+
"autopep8": {
326+
"title": "autopep8",
327+
"type": "object",
240328
"properties": {
241329
"enabled": {
242330
"title": "Enabled",
243331
"type": "boolean",
244332
"default": true,
245-
"description": "Enable or disable Yapf."
333+
"description":
334+
"Enable or disable autopep8. Formats code according to PyCodeStyle config. Requires `pyls` 0.17+"
246335
}
247336
}
248337
}

0 commit comments

Comments
 (0)