YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
26 stars 8 forks source link

Code Editor 2: Enhanced Note-links navigation #6740

Open yerumaku opened 4 months ago

yerumaku commented 4 months ago

Is your feature request related to a problem?

In large projects, navigation can be problematic. Even if you organize your resources well, you may not be able to quickly jump to the necessary elements, especially with the help of documentation.

Currently, the following link format is supported, which allows you to navigate only to resource files and quickly open them:

[Resource alias](project://GMResourceName) ### protocol style

This way, you can quickly navigate to the required resources, but the link functionality in notes can be improved to provide better navigation to already marked resources.


Describe the solution you'd like

I propose several new formats for links:

1. Search and filters in the asset browser

1.1. Search in the asset browser

[rooms](search://rm_) ### protocol style
[rooms](project://?search=rm_) ### query style
[rooms](browser://?search=rm_) ### protocol and query style

Clicking the [rooms]() link will show the asset browser and set the search field to the string after search://, in this example rm_, which will display all resources containing this text in their name.

1.2. Filtering using tags

[tutorial skills](tags://Tutorial,Skill) ### protocol style
[tutorial skills](project://?tags=Tutorial,Skill) ### query style
[tutorial skills](browser://?tags=Tutorial,Skill) ### protocol and query style

Clicking the [tutorial skills]() link will show the asset browser and set the asset filter by tags listed after tags://, separated by commas. In this example, the filter will be applied to two tags at once, Tutorial and Skill, displaying all resources with these tags in the project metadata.

1.3. Filtering using asset types

[sequence scripts](assets://GMScript,GMSequence) ### protocol style
[sequence scripts](assets://asset_script,asset_sequence) ### protocol style
[sequence scripts](project://?assets=asset_script,asset_sequence) ### query style
[sequence scripts](browser://?assets=asset_script,asset_sequence) ### protocol and query style

Clicking the [sequence scripts]() link will show the asset browser and set the asset filter by asset types listed after assets://, separated by commas. In this example, the filter will be applied to two asset types, asset_script and asset_sequence, displaying all resources with these types.

1.4. Combination of multiple filters If using the query style for resource filtering and search, you can combine these asset browser queries to include all necessary filters and find specified resources. Combination using ;

[sequence scripts](project://?assets=asset_script,asset_sequence;tags=Tutorial) ### query style

2. Quick jumps to declarations in code To speed up navigation to declarations in code, other protocols or commands can be used.

2.1. - 2.3. Quick jumps to functions, enums, and macros

[alias of function](function://my_some_fn_name) ### protocol style
[Input Direction](enum://InputDirection) ### protocol style
[max health](macro://max_health) ### protocol style

This way, we can jump to declarations of enums, functions, macros, and even specific object events. Since the IDE already allows navigation to definitions using F1, this can also work when clicking a link in a note.

Also, if a token of a keyword, language constant, language function, or built-in variable is used, it will jump to the documentation, similar to how it happens from the code when pressing F1.

2.4. Jump to object events

[player create event](event://obj_Player:create_event) ### protocol style

For objects, this can be a combination that allows jumping to specific events.

2.5. Jump to sequence events

[squence step event](event://seq_SplitScreen:step_normal) ### protocol style

When a sequence asset has an event assigned through the sequence editor, you can jump to sequence events directly from the documentation, bypassing the editor.

2.6. Jump to sequence and timeline moments

[teleport moment (60)](moment://seq_TeleportAnimation:60) ### protocol style
[timeline moment (10)](moment://tl_SayHello:10) ### protocol style

When a Sequence asset has a moment code assigned through the sequence editor, you can jump to the moment code directly from the documentation, bypassing the editor. Similarly for Timeline asset.

3. Quick code search

[sequence scripts](find://player.x) ### protocol style
[sequence scripts](search://player.x) ### protocol style

Launches a global code search for the fragment player.x, similar to the global search command.


Describe alternatives you've considered

Nope alternative path.

Additional context

I believe the community can suggest even more ways to improve links within the documentation.

DragoniteSpam commented 4 months ago

This actually already works in the Included Files markdown editor.

[click to open the player object](project://obj_player)

image

Having it work in comments in regular code editors would be of limited use because you can already middle click/F1 an asset name in a comment to go to it.

Being able to use something like search:// or tags:// to find all assets of a particular attribute would be very interesting.