I am using VS2012. I tried to navigate the function definition using the context menu item "Go to definition", but the menu item is disabled.
How to enable Go to definition menu?
Delete or rename (the extension) of the SUO file in the project (root of the directory) and that should correct your issue.
Related
I have a directory that I use for my PYTHONPATH: c:\test\my\scripts\. In this directory, I have some modules I import. It works well in my Python shell.
How do I add this directory path to PyCharm, so I can import what is in that directory?
Out of data, see Duane's answer below.
You need to go to the Main PyCharm Preferences, which will open up a separate window. In the left pane, choose Project:... > Project Interpreter. Now, in the main pane on the right, click the settings symbol (gear symbol) next to the field for "Project Interpreter". Choose More or Show All in the menu that pops up. Now in the final step, pick the interpreter you are using for this project and click on the tree symbol at the bottom of the window (hovering over the symbol reveals it as "Show paths for the selected interpreter"). Add your path by click in the "plus" symbol.
It took me ages to find, so I hope the detailed instructions will help. Further details are available in the PyCharm docs.
It is good practice to have __init__.py in each subfolder of the module you are looking to add, as well as making your project folder a 'Source Root'. Simply right-click on the folder in the path bar and choose 'Mark Directory as ...'
For Pycharm Community 2019.3
File
Settings
Project
Project Interpreter
Cog in top right => Show all
Select the interpreter
On the right toolbar, there are 5 icons, bottom one looks like a folder tree, click it
Press plus +
Select directory, press OK
In PyCharm Community 2019.2/2019.3 (and probably other versions), you can simply:
right-click any folder in your project
select "Mark Directory As"
select "Sources Root"
Modules within that folder will now be available for import. Any number of folders can be so marked.
The following answer is for PyCharm 2022.1.3+ (Professional Edition).
Open up Preferences (mac: ⌘ + ,)
Click on Project and then Project Interpreter
Click on the three vertical dots and the on Show All...
Choose your interpreter and then click on the directory structure icon
Click on the + icon and add the path you need to add to PYTHONPATH.
That's it!
enter image description here
you can go to setting in pycharm
and set interpreter python
I'm trying to add a command to the Document Tab context menu in Visual Studio 2019 so I can go directly to the open file in the Solution Explorer. I'm aware of File Tracking. I don't want to open the folder for every file tab I click on. I'm also aware of this extension but it seems like I have to click it two, sometimes three times before it will go to the file.
I found the relevant context menu under Customize -> Commands. It's "Other Context Menus | Easy MDI Document Window". The problem is that under "Add Command" you can only add from preselected lists of commands, and they don't make things easy to find.
I can see the command I want to add under Options -> Environment -> Keyboard. It's SolutionExplorer.SyncWithActiveDocument. But I don't see any way to use it in the Customize window, or if it's there I can't find it.
You can directly add commands to a menu only from the existing VS menus.
For additional commands, you can create an intermediate command with my Visual Commander extension DTE.ExecuteCommand("SolutionExplorer.SyncWithActiveDocumen") and then add this VCmd.Command01 command to the menu.
I am in the process of trying to add a main menu to my app.
From the google docs:
To define the menu, create an XML file inside your project's res/menu/ directory and build the menu with the following elements:
I created a "menu" file in the /res folder. However it didn't appear even though trying to create a new "menu" folder resulted in an error, meaning it exists but does not appear in "android" view.
So according to this answer I changed to packages view to see my newly created menu directory.
I tried to create a new resource file in my menu directory. Then this happens:
I am currently stuck.
change to android view then right click res folder -> select new android resource file. see then window will show, select "Resource Type" to MENU and input file name then it will automatically create the parent MENU folder and menu resource file. see
the menu that you haved created under res should start with capital letter. menu not Menu
I would like to add an include and library path to the default configuration in VC++ 2012. I know I can add it manually per project, but there is a checkbox "Inherit from parent or project defaults". I would like to modify this "project defaults" so it applies to all my projects.
Any clue of where to edit this?
***EDIT
No, that answer doesn't help. I edited the vsvars32.bat file, run the bat to check that INCLUDE and LIB variables where updated with my own path (and they are), but when I start MSVC++ 2012 my added path is not included.
It's a bit of a pain, and there is a blog post on MSDN that explains in detail, but in summary here's how you do it:
Open a project, any project.
From the menu, choose View / Property Manager (near the bottom of the menu)
In the property manager window, expand the project tree to show Debug and Release nodes
Expand either Debug or Release (it doesn't matter which)
Right-click on Microsoft.Cpp.Win32.user
Choose Properties from the pop-up menu
You should see a dialog where you can edit the VC++ Directories entry like this:
Once you OK through everything, any project you create or load will inherit these defaults.
I want to exclude some of the files in code folders from TFS 2012 source control.
Before VS2012 this was done by the "Exclude from source control" command available in "Source Control Explorer"s right-click menu. But in VS2012 I can not find it.
Does anybody know where it is ?
(I am using a "Local" workspace by the way.)
When you click on "Detected Changes" in the Team Explorer pane, "Promote Candidate Changes" window opens. This window allows you to select among detected changes and promote them to a source controlled item.
In this "Promote Candidate Changes" window, you select a file (or multi select files with Shift), right-click on it and a context menu pops up which contains an "ignore this local item" option. If you you click on it, selected files are excluded from source control.
Visual Studio adds a file named ".tfignore" to the source control mapping root, which contains names of all files to be ignored by source control. (Previous TFS versions did not produce this file but they were all server workspaces. Since this is a "Local" workspace, filenames to be ignores need to be kept in the workspace)
I have the real solution.
In the "team explorer" pane, in the "pending changes" tab, right click a new file you don't want in source control, and click "undo".
It will leave the file in the project, and exclude it from TFS. In the project window, the file will never have a "lock" icon on the left of its name.
This is the easiest solution:
1. Select the file(s) in Solution Explorer
2. Go to File -> Source Control -> Advanced
and here it is
Keep in mind:
If you right click a file in Solution Explorer you only find "the most important options" not all :)
In VS2013 this is back but has been moved to the file menu: -
Select the file in the Solution Explorer
File > Source Control > Advanced > Exclude xxx.xxx from Source Control
I know that this is slightly off topic but thought it may help someone.
I have Visual Studio 2017 Enterprise, and the option to exclude does not exist under File->Source Control. My solution to this problem was to open the Source Control Explorer, and remove the item I wanted to exclude.
It's in the Pending Changes pane separated to Excluded Changes and Included Changes sections. It allows filtering and excluding or promoting items between sections.
!