(settings: any[])
| 235 | // For backwards compatibility, set python.pythonPath to the configured |
| 236 | // value as though it were in the user's settings.json file. |
| 237 | const addPythonPath = (settings: any[]): Promise<any[]> => { |
| 238 | const pythonPathPromises: Promise<string | undefined>[] = params.items.map((item) => { |
| 239 | if (item.section === 'python') { |
| 240 | const uri = item.scopeUri ? Uri.parse(item.scopeUri) : undefined; |
| 241 | return getPythonPathFromPythonExtension(client.outputChannel, uri, () => { |
| 242 | // Posts a "workspace/didChangeConfiguration" message to the service |
| 243 | // so it re-queries the settings for all workspaces. |
| 244 | client.sendNotification(DidChangeConfigurationNotification.type, { |
| 245 | settings: null, |
| 246 | }); |
| 247 | }); |
| 248 | } |
| 249 | return Promise.resolve(undefined); |
| 250 | }); |
| 251 | |
| 252 | return Promise.all(pythonPathPromises).then((pythonPaths) => { |
| 253 | pythonPaths.forEach((pythonPath, i) => { |
| 254 | // If there is a pythonPath returned by the Python extension, |
| 255 | // always prefer this over the pythonPath that uses the old |
| 256 | // mechanism. |
| 257 | if (pythonPath !== undefined) { |
| 258 | settings[i].pythonPath = pythonPath; |
| 259 | } |
| 260 | }); |
| 261 | return settings; |
| 262 | }); |
| 263 | }; |
| 264 | |
| 265 | return addPythonPath(result); |
| 266 | }, |
no test coverage detected
searching dependent graphs…