MagicStack / MagicStack/MagicPython

Add scope for function parameter used inside function

Open
#208 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.4k
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Got send here from 'vscode-python' https://github.com/microsoft/vscode-python/issues/11594
```
def function(param1):
x = 1
return param1 * x
```
Both `x` and `param1` are variables used inside the `function`, but `param1` is a given parameter.

In the function def line `param1` has a special scope but not when used inside the function.
I'd like to have it have a special textmate scope too so I can color it and see, when I use a parameter and when a 'normal' variable.

The left side is what I want (from PyCharm) and the right side is as currently is.
![image](https://user-images.githubusercontent.com/43916661/81099878-e05fac00-8f0b-11ea-9b84-dd623270aa8b.png)

Contributor guide

No contributing guide indexed for this repository

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

The issue names no implementation files or tests; start by locating MagicPython’s Python syntax-highlighting rules and comparing the function example’s parameter definition with its use inside the function. Done means parameter references receive a distinct TextMate scope from ordinary local variables, with coverage for the shown example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
devtools, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.