Skip to content

Fix "take every value" in python#258

Merged
AndreasArvidsson merged 3 commits intomasterfrom
fix-python-values
Sep 5, 2021
Merged

Fix "take every value" in python#258
AndreasArvidsson merged 3 commits intomasterfrom
fix-python-values

Conversation

@pokey
Copy link
Copy Markdown
Member

@pokey pokey commented Sep 3, 2021

Fixes #257

Mixed feelings about this solution. There is no way to exclude two types, for example.

The alternative would be to explicitly list the types that we want to allow user to use "value" field with. There are about 7

@pokey pokey changed the title Fix "clear every value" in python Fix "take every value" in python Sep 3, 2021
Comment thread src/languages/python.ts
namedFunction: "decorated_definition?.function_definition",
functionName: "function_definition[name]",
type: ["function_definition[return_type]", "*[type]"],
type: valueMatcher("function_definition[return_type]", "*[type]"),
Copy link
Copy Markdown
Member Author

@pokey pokey Sep 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is so that the leading : gets deleted when using "chuck type"

- anchor: {line: 0, character: 2}
active: {line: 0, character: 2}
finalState:
documentContents: "foo: str "
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prob clean up this trailing string too, but prob best to leave that one for object-oriented targets refactor

@AndreasArvidsson
Copy link
Copy Markdown
Member

I'm unsure. I think this could be a reoccurring problem in different languages. One solution could be that we do an ancestral crawl and just pick the highest match. Maybe should have dialogue about this before doing anything?

@pokey
Copy link
Copy Markdown
Member Author

pokey commented Sep 4, 2021

I'm unsure. I think this could be a reoccurring problem in different languages. One solution could be that we do an ancestral crawl and just pick the highest match. Maybe should have dialogue about this before doing anything?

not sure i follow; yes let's discuss

@AndreasArvidsson AndreasArvidsson merged commit cd8258f into master Sep 5, 2021
@AndreasArvidsson AndreasArvidsson deleted the fix-python-values branch September 5, 2021 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"take every value" is broken in python

2 participants