-
Notifications
You must be signed in to change notification settings - Fork 3k
Find your way around the code
Once you have successfully compiled MuseScore and found a task or issue you want to tackle, the next step is to find the relevant part of the code.
It's a good idea to search the source code for terms related to the issue. If the issue has screenshots with any UI text visible, try searching for that text; there's a good chance it's defined near the code you need to edit.
The search feature here on GitHub is a good place to start.
Example GitHub query | Searches for files that... |
---|---|
note input |
Have the word "note" and the word "input" in the content or in the path. |
"note input" |
Have the exact string "note input" (without quotes) in the content or in the path. |
content:/note ?(input|entry)/ |
Contain the exact string "note input", "noteinput", "note entry", or "noteentry". |
content:/"note-[a-g]"/ |
Contain the exact string "note-a", or "note-b", or ... "note-g" (with quotes this time). |
path:score language:cpp |
Are C++ files (including headers) with "score" somewhere in the path. |
path:score path:.cpp |
Have "score" and ".cpp" somewhere in the path. |
content:score NOT path:/\.cpp$/ |
Contain "score" but the path does not end in ".cpp". |
symbol:rest |
Use "rest" in the name of a code symbol (i.e. a variable, function, or class). |
See GitHub search syntax for more details, or use advanced search. Remember to restrict it to repo:musescore/MuseScore
.
GitHub only searches the default branch (i.e. master
). If you want to search other branches (e.g. 4.2.0
or 3.x
) then you need to use offline search instead.
The command line program ripgrep (rg
) is like Unix grep
but faster and more powerful. It enables you to search for strings and regular expressions in lots of files very quickly. By default, ripgrep ignores binary files and files that are ignored by Git, such as those in the builds
directory created by build.cmake
.
Here's an example of how to use ripgrep:
rg -Fi "note input"
This performs a case-insensitive search for "note input" in all files in the repository.
Useful options for ripgrep:
- Omit
-F
to search for a regular expression instead of a fixed string. - Omit
-i
to make the search case-sensitive (i.e. to avoid matching "Note Input" and "NOTE INPUT"). - Add
src
to the end of the command to restrict the search to the src directory instead of the whole repository.
Install ripgrep using the command for your package manager and see rg --help
for more options.
IDEs often have useful shortcuts to make it easier to navigate code.
Press F4 in any .cpp
file to be taken to the corresponding .h
file, if there is one, and vice versa.
Click on the name of any symbol (variable, function, class, etc.) and press F2 to be taken to where the symbol is declared/defined.
Right-click on the name of any symbol and choose this option to see a list of other places the symbol occurs (basically an intelligent search facility).
Testing
- Manual testing
- Automatic testing
Translation
Compilation
- Set up developer environment
- Install Qt and Qt Creator
- Get MuseScore's source code
- Install dependencies
- Compile on the command line
- Compile in Qt Creator
Beyond compiling
Architecture
Misc. development
Audio
Engraving
- Style settings
- Working with style files
- Style parameter changes for 4.0
- Style parameter changes for 4.1
- Style parameter changes for 4.2
- Style parameter changes for 4.3
- Style parameter changes for 4.4
Extensions
- Extensions overview
- Manifest
- Forms
- Macros
- Extensions API
- Legacy plugin API
Google Summer of Code
References