Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

feat: navigate to next / previous declaration #511

Merged
merged 62 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
2cfeb01
feat: Removed all previous filters and added new filter "hasName"
Masara May 20, 2022
75f4335
refactor: New names for abstract AbstractPythonFilter.ts functions
Masara May 20, 2022
124f9a0
feat: Added is-filter, not working yet tho
Masara May 20, 2022
973a4ee
feat: Adjustments for filtering
Masara May 20, 2022
cf53023
Merge branch 'main' into 487-api_editor_aditional_filter_commands
lars-reimann May 20, 2022
ef49715
fix: update menu bar again
lars-reimann May 20, 2022
52ba9f6
fix: filter logic (probably not perfect yet)
lars-reimann May 20, 2022
04bffcd
style: apply automatic fixes of linters
lars-reimann May 20, 2022
0c2c967
refactor: move filter logic completely into the filters
lars-reimann May 21, 2022
a7e3ded
style: apply automatic fixes of linters
lars-reimann May 21, 2022
9e009f1
fix: filter logic
lars-reimann May 21, 2022
71af8e0
style: apply automatic fixes of linters
lars-reimann May 21, 2022
acf6eea
fix: remove skip logic (no longer provides better performance)
lars-reimann May 21, 2022
e0fafe5
style: apply automatic fixes of linters
lars-reimann May 21, 2022
7ac3eba
refactor: remove null filter (same as empty ConjunctiveFilter)
lars-reimann May 23, 2022
75751dc
refactor: filter factory
lars-reimann May 23, 2022
f8cf213
fix: popover warning
lars-reimann May 23, 2022
fb86683
feat: negated filters
lars-reimann May 23, 2022
c322fdd
refactor: remove setting "show private declarations"
lars-reimann May 23, 2022
a52be1b
fix: help text for "name" filter
lars-reimann May 23, 2022
6a47fc5
feat: improved help text
lars-reimann May 23, 2022
59f5b97
feat: boldface for filtered elements
lars-reimann May 23, 2022
82e6fe1
Merge branch 'main' into 487-api_editor_aditional_filter_commands
lars-reimann May 23, 2022
af102b9
feat: ignore casing of filters
lars-reimann May 23, 2022
341a6e6
perf: memoization of TreeView
lars-reimann May 23, 2022
3ade1b4
style: apply automatic fixes of linters
lars-reimann May 23, 2022
ec4d07c
feat: filter `annotation:any`
lars-reimann May 23, 2022
155eb6c
fix: incorrect filtering of parameters
lars-reimann May 23, 2022
3b70a66
fix: remove console.log
lars-reimann May 23, 2022
98f0214
style: apply automatic fixes of linters
lars-reimann May 23, 2022
fbbdd5a
feat: update help text
lars-reimann May 23, 2022
e41b286
style: use === instead of ==
lars-reimann May 24, 2022
ae5dbbe
feat: filters for specific annotations
lars-reimann May 24, 2022
ceb53b2
style: apply automatic fixes of linters
lars-reimann May 24, 2022
20289c8
docs: add code documentation for filters
lars-reimann May 24, 2022
82583a3
fix: filter text
lars-reimann May 24, 2022
8abc2ea
style: apply automatic fixes of linters
lars-reimann May 24, 2022
58b4438
Merge branch 'main' into 487-api_editor_aditional_filter_commands
lars-reimann May 24, 2022
2d81267
feat: minor GUI improvements
lars-reimann May 25, 2022
4ee8068
style: apply automatic fixes of linters
lars-reimann May 25, 2022
5481ae9
refactor: remove commented out code
lars-reimann May 25, 2022
82f33b7
feat: compute which modules are public
lars-reimann May 25, 2022
92fe9b3
feat: emphasize important parts in help text
lars-reimann May 25, 2022
a0dc4ee
fix: inability to add annotation to parameters of functions if they w…
lars-reimann May 25, 2022
7581a85
style: apply automatic fixes of linters
lars-reimann May 25, 2022
f58efab
test: applyToPackage
lars-reimann May 25, 2022
1720407
test: createFilterFromString
lars-reimann May 25, 2022
8b28653
style: apply automatic fixes of linters
lars-reimann May 25, 2022
27fc09f
Merge branch 'main' into 487-api_editor_aditional_filter_commands
lars-reimann May 25, 2022
9980f8c
small changes for arsam
jofaul May 27, 2022
41f641d
treeview now expands when selecting new elements through next and pre…
jofaul May 27, 2022
025fc27
style: Styling for the "next / previous declaration" buttons
Masara May 27, 2022
4f5a073
Go to first/last element implemented
jofaul May 27, 2022
c338375
small bugfix
jofaul May 27, 2022
160039d
style: Styling for the "next / previous declaration" buttons
Masara May 27, 2022
e78f01f
Merge remote-tracking branch 'origin/167-Navigate_to_next_previous_de…
Masara May 27, 2022
c42ebcc
feat: when an element that isnt included in the current filter is sel…
jofaul May 27, 2022
27de616
Merge branch 'main' into 167-Navigate_to_next_previous_declaration
lars-reimann May 27, 2022
53a15c8
style: apply automatic fixes of linters
lars-reimann May 27, 2022
3ba31d9
refactor: move previous/next buttons into SelectionView
lars-reimann May 27, 2022
b5bb858
refactor: use HStack instead of Box
lars-reimann May 27, 2022
c4c2acd
style: apply automatic fixes of linters
lars-reimann May 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Added is-filter, not working yet tho
  • Loading branch information
Masara committed May 20, 2022
commit 124f9a08ddf3e8cf09ff01938b3207a2915e7465
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isEmptyList } from '../../../common/util/listOperations';
import { Optional } from '../../../common/util/types';
import PythonDeclaration from './PythonDeclaration';
import { PythonFilter } from './PythonFilter';
import PythonFunction from './PythonFunction';
import PythonModule from './PythonModule';
import AbstractPythonFilter from "./AbstractPythonFilter";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import PythonClass from './PythonClass';
import PythonFunction from './PythonFunction';
import PythonModule from "./PythonModule";
import PythonParameter from "./PythonParameter";
import AbstractPythonFilter from "./AbstractPythonFilter";

export default class PythonDeclerationTypeFilter extends AbstractPythonFilter {
constructor(
readonly type: DeclerationType,
) {
super();
}

shouldKeepModule(pythonModule: PythonModule): boolean {
return this.type == DeclerationType.module;
}

shouldKeepClass(pythonClass: PythonClass): boolean {
return this.type == DeclerationType.class;
}

shouldKeepFunction(pythonFunction: PythonFunction): boolean {
return this.type == DeclerationType.function
}

shouldKeepParameter(pythonParameter: PythonParameter): boolean {
return this.type == DeclerationType.parameter;
}

isFilteringModules(): boolean {
return this.type != DeclerationType.module;
}

isFilteringClasses(): boolean {
return this.type != DeclerationType.class;
}

isFilteringFunctions(): boolean {
return this.type != DeclerationType.function
}

isFilteringParameters(): boolean {
return this.type != DeclerationType.parameter;
}
}

export enum DeclerationType {
module, class, function, parameter
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Optional } from '../../../common/util/types';
import PythonClass from './PythonClass';
import PythonDeclaration from './PythonDeclaration';
import { PythonFilter } from './PythonFilter';
import PythonModule from './PythonModule';
import PythonParameter from './PythonParameter';
import PythonResult from './PythonResult';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Optional } from '../../../common/util/types';
import PythonClass from './PythonClass';
import PythonFunction from './PythonFunction';
import PythonPackage from './PythonPackage';
import PythonModule from "./PythonModule";
import PythonParameter from "./PythonParameter";
import AbstractPythonFilter from "./AbstractPythonFilter";

export default class PythonHasNameFilter extends AbstractPythonFilter {
containingPackage: Optional<PythonPackage>;

constructor(
readonly name: string,
) {
Expand Down
19 changes: 19 additions & 0 deletions api-editor/gui/src/features/packageData/model/filterFactory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {CompoundFilter} from "./CompoundFilter";
import PythonHasNameFilter from "./PythonHasName";
import AbstractPythonFilter from "./AbstractPythonFilter";
import PythonDeclerationTypeFilter, {DeclerationType} from "./PythonDeclerationType";

export function createFilterFromString(filterBoxInput: string): AbstractPythonFilter {
const filters = []
Expand All @@ -12,6 +13,24 @@ export function createFilterFromString(filterBoxInput: string): AbstractPythonFi
switch (scope) {
case 'hasName':
filters.push(new PythonHasNameFilter(filterString))
break;
case 'is':
switch (filterString) {
case 'module':
filters.push(new PythonDeclerationTypeFilter(DeclerationType.module))
break
case 'class':
filters.push(new PythonDeclerationTypeFilter(DeclerationType.class))
break
case 'function':
filters.push(new PythonDeclerationTypeFilter(DeclerationType.function))
break
case 'parameter':
filters.push(new PythonDeclerationTypeFilter(DeclerationType.parameter))
break
// no default
}

break;
// no default
}
Expand Down