microsoft / microsoft/vscode-cpptools

Please add env/envFile support for LanguageServer

Open
#4,759 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Configuration Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: General
Describe the bug

  • OS and Version: Ubuntu 19.10
  • VS Code Version: 1.41.0
  • C/C++ Extension Version: 0.26.2

Related issues: #4691, #4178, #3078

Description
It is common that compiler requires extra environment variables to run correctly (PATH, LD_LIBRARY_PATH, even less-known CPATH in my case) which are provided by some kind of "activation script".

Without proper setting of such variables detecting compiler's default include paths and defines doesn't work (or doesn't work as expected).

Proposal
env / envFile settings are getting more and more wide-spread and it would be awesome if cpptools respects them when detecting compiler and its settings (even via compile_commands.json).
Having such option per-configuration and per-project significantly improves experience when developer needs to switch between different compilers.

Unfortunately I couldn't find place in the repo where compiler is invoked...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the LanguageServer compiler-detection path and its handling of compile_commands.json; the issue names no repository files or tests. Compare the requested per-configuration and per-project env/envFile behavior with the existing settings, and define done as compiler default include paths and defines being detected correctly under activated environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.