回答編集履歴
5
追記
answer
CHANGED
@@ -7,8 +7,14 @@
|
|
7
7
|
Python(拡張機能) 2018.2.1
|
8
8
|
```
|
9
9
|
|
10
|
-
推測だと行数が大きいモジュールの場合、Intellisenseの解決に実行に時間がかかりすぎてタイムアウトになっているみたいです。
|
11
10
|
|
11
|
+
推測ですが大規模モジュールの場合、`Intellisense`の名前解決の実行時間がかかりすぎてタイムアウトになっているみたいです。
|
12
|
+
|
13
|
+
■問題が発生するモジュール
|
14
|
+
numpy
|
15
|
+
pandas
|
16
|
+
tensorflow
|
17
|
+
|
12
18
|
■対応策として以下のように変数を宣言する時に、`:`で型ヒント情報を与えればIntellisenseが効きました。
|
13
19
|
```Python
|
14
20
|
df: pd.DataFrame = pd.read_csv('data.csv')
|
@@ -35,4 +41,5 @@
|
|
35
41
|
■参考情報
|
36
42
|
[PEP 526: 変数アノテーションの文法](https://docs.python.jp/3/whatsnew/3.6.html#whatsnew36-pep526)
|
37
43
|
[Intellisense for site-packages doesn't work as intended #720](https://github.com/Microsoft/vscode-python/issues/720)
|
38
|
-
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|
44
|
+
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|
45
|
+
[Slow autocompletion/formatting](https://github.com/DonJayamanne/pythonVSCode/issues/581)
|
4
追記
answer
CHANGED
@@ -9,13 +9,11 @@
|
|
9
9
|
|
10
10
|
推測だと行数が大きいモジュールの場合、Intellisenseの解決に実行に時間がかかりすぎてタイムアウトになっているみたいです。
|
11
11
|
|
12
|
-
■対応策として
|
12
|
+
■対応策として以下のように変数を宣言する時に、`:`で型ヒント情報を与えればIntellisenseが効きました。
|
13
13
|
```Python
|
14
|
-
df:pd.DataFrame = pd.read_csv('data.csv')
|
14
|
+
df: pd.DataFrame = pd.read_csv('data.csv')
|
15
15
|
```
|
16
16
|
|
17
|
-
変数名:クラス名で型ヒント情報を渡させば、Intellisenseが効きました。
|
18
|
-
|
19
17
|
こちらの環境の`settings.json`です、ご参考まで。
|
20
18
|
```json
|
21
19
|
{
|
@@ -35,5 +33,6 @@
|
|
35
33
|
```
|
36
34
|
|
37
35
|
■参考情報
|
36
|
+
[PEP 526: 変数アノテーションの文法](https://docs.python.jp/3/whatsnew/3.6.html#whatsnew36-pep526)
|
37
|
+
[Intellisense for site-packages doesn't work as intended #720](https://github.com/Microsoft/vscode-python/issues/720)
|
38
|
-
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|
38
|
+
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|
39
|
-
[Intellisense for site-packages doesn't work as intended #720](https://github.com/Microsoft/vscode-python/issues/720)
|
3
再現したので、追記
answer
CHANGED
@@ -1,7 +1,37 @@
|
|
1
|
-
|
1
|
+
こちらの環境でも問題が再現しました。
|
2
2
|
|
3
|
+
```txt
|
4
|
+
Windows 10
|
5
|
+
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
|
6
|
+
VSCode 1.21.1
|
7
|
+
Python(拡張機能) 2018.2.1
|
8
|
+
```
|
9
|
+
|
10
|
+
推測だと行数が大きいモジュールの場合、Intellisenseの解決に実行に時間がかかりすぎてタイムアウトになっているみたいです。
|
11
|
+
|
12
|
+
■対応策として
|
13
|
+
```Python
|
14
|
+
df:pd.DataFrame = pd.read_csv('data.csv')
|
15
|
+
```
|
16
|
+
|
17
|
+
変数名:クラス名で型ヒント情報を渡させば、Intellisenseが効きました。
|
18
|
+
|
19
|
+
こちらの環境の`settings.json`です、ご参考まで。
|
3
20
|
```json
|
21
|
+
{
|
4
|
-
"python.
|
22
|
+
"python.pythonPath": "C:\ProgramData\Anaconda3\python.exe",
|
23
|
+
"python.linting.enabled": true,
|
24
|
+
"python.autoComplete.addBrackets": true,
|
25
|
+
"python.autoComplete.extraPaths": [
|
26
|
+
"C:\ProgramData\Anaconda3\Lib\site-packages"
|
27
|
+
],
|
28
|
+
"python.linting.pylintArgs": [
|
29
|
+
"--ignored-modules=numpy,pandas,matplotlib",
|
30
|
+
"--ignored-classes=numpy,pandas,matplotlib",
|
31
|
+
"--extension-pkg-whitelist=numpy,pandas,matplotlib"
|
32
|
+
],
|
33
|
+
"files.autoSave": "afterDelay"
|
34
|
+
}
|
5
35
|
```
|
6
36
|
|
7
37
|
■参考情報
|
2
参考情報を追加
answer
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
`preloadModules`に値を追加して`VSCode`を再起動して実行してみ
|
1
|
+
`preloadModules`に値を追加して`VSCode`を再起動して実行してみはどうでしょうか。
|
2
2
|
|
3
3
|
```json
|
4
4
|
"python.autoComplete.preloadModules": ["numpy", "pandas", "matplotlib"],
|
5
5
|
```
|
6
6
|
|
7
7
|
■参考情報
|
8
|
-
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|
8
|
+
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|
9
|
+
[Intellisense for site-packages doesn't work as intended #720](https://github.com/Microsoft/vscode-python/issues/720)
|
1
コードタグを追加
answer
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
preloadModulesに値を追加してVSCodeを再起動して実行してみるとどうなりますかー?
|
1
|
+
`preloadModules`に値を追加して`VSCode`を再起動して実行してみるとどうなりますかー?
|
2
2
|
|
3
|
+
```json
|
3
4
|
"python.autoComplete.preloadModules": ["numpy", "pandas", "matplotlib"],
|
5
|
+
```
|
4
6
|
|
5
7
|
■参考情報
|
6
8
|
[Editing Python in VS Code](https://code.visualstudio.com/docs/python/editing)
|