Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat SConstruct/SConscript files as python automatically #105623

Closed
philosophicles opened this issue Aug 28, 2020 · 7 comments
Closed

Treat SConstruct/SConscript files as python automatically #105623

philosophicles opened this issue Aug 28, 2020 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders languages-basic Basic language support issues verification-needed Verification of issue is requested verified Verification succeeded

Comments

@philosophicles
Copy link

SCons is a popular software build tool, a little like GNU Make, created with python.

By default and convention, it uses build definition files named SConstruct and SConscript in a source code directory hierarchy. These files are basically python scripts, albeit with some SCons-specific idioms.

VSCode should automatically recognize these special filenames and apply python language support, in much the same way that a file named Makefile is already recognized as special.

I am aware that it's easy to define this in Settings for a particular install of VS Code, but these filenames are quite universal and unlikely to ever be used for something other than SCons.

@aaronfranke
Copy link

It also uses SCsub files as well, to allow splitting the SCons code into multiple files and for uses such as modules.

@mwichmann
Copy link

It also uses SCsub files as well, to allow splitting the SCons code into multiple files and for uses such as modules.

SCsub is not a standard SCons thing. You can call the subsidiary files anything you want, as calling them is done by passing a filename to a method call, SConscript is just the conventional name, but using it is very common.

@aeschli
Copy link
Contributor

aeschli commented Aug 31, 2020

I'm not a Pythpn expert. Can you give me the complete list of filenames I should add to Python?
SConstruct and SConscript ?

@philosophicles
Copy link
Author

@aeschli yes, confirmed, just these two filenames please:

  1. SConstruct
  2. SConscript

(Rationale: both the above are referenced many times in the official SCons documentation. SCsub is not referenced at all in same.)

@aeschli aeschli added this to the September 2020 milestone Sep 1, 2020
@aeschli aeschli added feature-request Request for new features or functionality languages-basic Basic language support issues labels Sep 1, 2020
@aeschli aeschli closed this as completed in 849acd8 Sep 8, 2020
@aeschli aeschli added the verification-needed Verification of issue is requested label Sep 8, 2020
@bdbaddog
Copy link

bdbaddog commented Sep 8, 2020

Here's the default SConstruct file name variations from the manpage:
( https://scons.org/doc/production/HTML/scons-man.html )

When invoked, scons searches for a file named SConstruct (it also checks alternate spellings Sconstruct, sconstruct, SConstruct.py Sconstruct.py and sconstruct.py in that order)

@aeschli
Copy link
Contributor

aeschli commented Sep 9, 2020

I added the two file names above and would leave it at that until we get requests. Hope that's ok.

@bdbaddog
Copy link

bdbaddog commented Sep 9, 2020

@aeschli - Yup. Just figured I'd paste the definitive answer here for future reference. Most build systems actually use SConstruct and SConscript. Having VSCode recognize they're python files will certainly lessen the desire/need for SConstruct.py, etc.. Thanks!

@isidorn isidorn added the verified Verification succeeded label Sep 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders languages-basic Basic language support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@bdbaddog @mwichmann @aaronfranke @isidorn @philosophicles @aeschli and others