codemap.vscode icon indicating copy to clipboard operation
codemap.vscode copied to clipboard

Improving Generic Map by Reworking levelIndent

Open omemisoglu opened this issue 1 year ago • 1 comments

Enhancement Proposal

Codemap levelIndent property can cause improper or infinite nesting due to a only indent level handling. Introducing hierarchy level handling addition to indent level handling can resolve the issue.

Solution Description

Implementing hierarchy level by promoting levelIndent to identify not a whitespace indent on files, but a hierarchy level among other mapping rules of a indent dependant programming language file.

Non-hiearachy Mapping Rules

  • If a mapping rule has no hiearchy, it cannot nest other mapping rules.

Hierarchy Priority

  • Mapping rules with levelIndent property set other than zero (0) can nest lower level hierarchies (lower number, higher hierarchy).

Resolving Hierarchy with same Indentation

  • When mapping rules with levelIndent has same indentation, higher hierarchy mapping rule will nest lower level hierarchy.

Further Improvements to Proposal

  • [ ] Implementing mapping rule category: When different categories mapping rules with the same indentation but different hierarchy levels can nest each other.

  • [ ] Supporting non-indent based programming languages by improving hierarchy algorithm.

omemisoglu avatar Aug 26 '23 12:08 omemisoglu

Hi @omemisoglu, I noticed you have created the PR, so let's keep the conversation there.

oleg-shilo avatar Aug 27 '23 07:08 oleg-shilo