[GIS] QGIS Intellisense in Visual Studio Code

pyqgispythonqgisvisual-studio-code

I'm trying to get QGIS API intellisense in VS Code IDE but it doesn't work.

I'm using QGIS 3.4 and Windows 10.
I followed the instructions from this link: http://gis-expert.com/wp/2018/10/15/how-to-setup-qgis-3-and-visual-studio-code-plugin-development-windows/

I'm using: VS Code 1.29.1, extensions: Python and PYQT Integration.

This is my bat file:

@echo off
path %PATH%;C:\PROGRA~1\QGIS3~1.4\bin
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\qgis\bin
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\grass\grass-7.4.2\lib
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\Qt5\bin
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\qgis\python\qgis\PyQt
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\Python37\Scripts
set PYTHONPATH=%PYTHONPATH%;C:\PROGRA~1\QGIS3~1.4\apps\qgis\python
set PYTHONHOME=C:\Users\[username]\AppData\Local\Programs\Python\Python37
path %PATH%;C:\Users\[username]\AppData\Local\Programs\Python\Python37\Scripts

start "VisualCode QGIS" /B "C:\Users\[username]\AppData\Local\Programs\Microsoft VS Code\Code.exe" %*

Python and PyQT intellisense are ok, QGIS not.
Can you help me?

Best Answer

this is my .bat for VS Code try with this

@ECHO OFF 

set OSGEO4W_ROOT=D:\OSGeo4W64

@echo off
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call "%OSGEO4W_ROOT%\bin\qt5_env.bat"
call "%OSGEO4W_ROOT%\bin\py3_env.bat"

@echo off
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis
set GDAL_FILENAME_IS_UTF8=YES

set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python;%PYTHONPATH%

cd /d %~dp0

SET VSCBIN=D:\Users\fran\AppData\Local\Programs\Microsoft VS Code

call "%VSCBIN%\Code.exe" %*

I hope I help you

Related Question