]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRemove more copy-paste
Aleksey Kladov [Fri, 20 Dec 2019 12:19:41 +0000 (13:19 +0100)]
Remove more copy-paste

4 years agoRemove more copy-paste
Aleksey Kladov [Fri, 20 Dec 2019 12:11:01 +0000 (13:11 +0100)]
Remove more copy-paste

4 years agoMerge #2608
bors[bot] [Fri, 20 Dec 2019 11:43:19 +0000 (11:43 +0000)]
Merge #2608

2608: Support for nested traits r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSupport for nested traits
Aleksey Kladov [Fri, 20 Dec 2019 11:29:25 +0000 (12:29 +0100)]
Support for nested traits

4 years agoSupport for nested statics, consts and type aliases
Aleksey Kladov [Fri, 20 Dec 2019 11:22:55 +0000 (12:22 +0100)]
Support for nested statics, consts and type aliases

4 years agoSupport for nested ADT
Aleksey Kladov [Fri, 20 Dec 2019 11:20:49 +0000 (12:20 +0100)]
Support for nested ADT

4 years agoIntroduce `ContainerId`
Aleksey Kladov [Fri, 20 Dec 2019 11:07:23 +0000 (12:07 +0100)]
Introduce `ContainerId`

4 years agoRename ContainerId -> AssocContainerId
Aleksey Kladov [Fri, 20 Dec 2019 10:59:50 +0000 (11:59 +0100)]
Rename ContainerId -> AssocContainerId

4 years agoMerge #2607
bors[bot] [Fri, 20 Dec 2019 10:56:59 +0000 (10:56 +0000)]
Merge #2607

2607: More ground work for local defs r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRebuild ra_lsp_server and nest helper function.
Aleksey Kladov [Fri, 20 Dec 2019 10:30:22 +0000 (11:30 +0100)]
Rebuild ra_lsp_server and nest helper function.

Completion now works again, so there's no need not to nest

4 years agoHandle nested declrations in from_source
Aleksey Kladov [Fri, 20 Dec 2019 10:24:23 +0000 (11:24 +0100)]
Handle nested declrations in from_source

4 years agoAdd local functions to bodies
Aleksey Kladov [Fri, 20 Dec 2019 10:19:09 +0000 (11:19 +0100)]
Add local functions to bodies

4 years agoMerge #2601
bors[bot] [Thu, 19 Dec 2019 17:32:51 +0000 (17:32 +0000)]
Merge #2601

2601: :arrow_up: deps r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: deps
Aleksey Kladov [Thu, 19 Dec 2019 17:28:57 +0000 (18:28 +0100)]
:arrow_up: deps

4 years ago:arrow_up: Rust
Aleksey Kladov [Thu, 19 Dec 2019 17:27:44 +0000 (18:27 +0100)]
:arrow_up: Rust

4 years agoMerge #2600
bors[bot] [Thu, 19 Dec 2019 17:22:40 +0000 (17:22 +0000)]
Merge #2600

2600: Plumbing for local items support r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoImplement ChildBySource for DefWithBody
Aleksey Kladov [Thu, 19 Dec 2019 17:21:26 +0000 (18:21 +0100)]
Implement ChildBySource for DefWithBody

4 years agoAdd body as a possible container for items
Aleksey Kladov [Thu, 19 Dec 2019 17:12:46 +0000 (18:12 +0100)]
Add body as a possible container for items

4 years agoAllow storing defs in bodies
Aleksey Kladov [Thu, 19 Dec 2019 16:30:28 +0000 (17:30 +0100)]
Allow storing defs in bodies

4 years agoMerge #2599
bors[bot] [Thu, 19 Dec 2019 17:08:12 +0000 (17:08 +0000)]
Merge #2599

2599: Drop dead code r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop dead code
Aleksey Kladov [Thu, 19 Dec 2019 17:07:39 +0000 (18:07 +0100)]
Drop dead code

4 years agoMerge #2598
bors[bot] [Thu, 19 Dec 2019 16:15:19 +0000 (16:15 +0000)]
Merge #2598

2598: Touch up TokenSet a bit r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoTouch up TokenSet a bit
Aleksey Kladov [Thu, 19 Dec 2019 16:13:08 +0000 (17:13 +0100)]
Touch up TokenSet a bit

4 years agoMerge #2597
bors[bot] [Thu, 19 Dec 2019 16:04:24 +0000 (16:04 +0000)]
Merge #2597

2597: Handle start imports in import groups r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoHandle start imports in import groups
Aleksey Kladov [Thu, 19 Dec 2019 15:57:22 +0000 (16:57 +0100)]
Handle start imports in import groups

4 years agoMerge #2594
bors[bot] [Thu, 19 Dec 2019 15:35:42 +0000 (15:35 +0000)]
Merge #2594

2594: Omit default parameter types r=matklad a=SomeoneToIgnore

Part of https://github.com/rust-analyzer/rust-analyzer/issues/1946

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoMerge #2596
bors[bot] [Thu, 19 Dec 2019 15:27:45 +0000 (15:27 +0000)]
Merge #2596

2596: Refactor macro tests r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRefactor macro tests
Aleksey Kladov [Thu, 19 Dec 2019 15:17:22 +0000 (16:17 +0100)]
Refactor macro tests

4 years agoRemove the setting change reminder
Kirill Bulatov [Thu, 19 Dec 2019 15:11:07 +0000 (17:11 +0200)]
Remove the setting change reminder

4 years agoOmit default types for hover pop-ups
Kirill Bulatov [Thu, 19 Dec 2019 14:47:09 +0000 (16:47 +0200)]
Omit default types for hover pop-ups

4 years agoRemove TruncateOptions struct
Kirill Bulatov [Thu, 19 Dec 2019 14:43:41 +0000 (16:43 +0200)]
Remove TruncateOptions struct

4 years agoDo not add any new configuration parameters
Kirill Bulatov [Thu, 19 Dec 2019 14:18:09 +0000 (16:18 +0200)]
Do not add any new configuration parameters

4 years agoMerge #2595
bors[bot] [Thu, 19 Dec 2019 13:45:10 +0000 (13:45 +0000)]
Merge #2595

2595: Fix parsing of interpolated expressions r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFix parsing of interpolated expressions
Aleksey Kladov [Thu, 19 Dec 2019 13:43:19 +0000 (14:43 +0100)]
Fix parsing of interpolated expressions

4 years agoEnsure hover shows full type declaration
Kirill Bulatov [Thu, 19 Dec 2019 10:45:00 +0000 (12:45 +0200)]
Ensure hover shows full type declaration

4 years agoOmit default parameter types
Kirill Bulatov [Sat, 7 Dec 2019 22:54:18 +0000 (00:54 +0200)]
Omit default parameter types

4 years agoMerge #2589 #2591
bors[bot] [Wed, 18 Dec 2019 16:54:28 +0000 (16:54 +0000)]
Merge #2589 #2591

2589: Touch up docs r=matklad a=matklad

2591: Remove dead code r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove dead code
Aleksey Kladov [Wed, 18 Dec 2019 16:52:52 +0000 (17:52 +0100)]
Remove dead code

4 years agoMerge #2311
bors[bot] [Wed, 18 Dec 2019 16:44:35 +0000 (16:44 +0000)]
Merge #2311

2311: See through Macros for SignatureHelp r=matklad a=kjeremy

Note: we meed to skip the trivia filter to make sure that
`covers!(call_info_bad_offset)` succeeds otherwise we exit call_info
too early.

Also the test doesn't pass: `FnCallNode::with_node` always detects
a MacroCall which is obviously wrong.

Fixes #2310

Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoTouch up docs
Aleksey Kladov [Wed, 18 Dec 2019 16:42:49 +0000 (17:42 +0100)]
Touch up docs

4 years agoForbid <T>::foo syntax in mod paths
Aleksey Kladov [Wed, 18 Dec 2019 16:41:33 +0000 (17:41 +0100)]
Forbid <T>::foo syntax in mod paths

4 years agoMove PathKindUp
Aleksey Kladov [Wed, 18 Dec 2019 16:06:52 +0000 (17:06 +0100)]
Move PathKindUp

4 years agoTouch up docs
Aleksey Kladov [Wed, 18 Dec 2019 16:04:20 +0000 (17:04 +0100)]
Touch up docs

4 years agoMerge #2588
bors[bot] [Wed, 18 Dec 2019 15:47:58 +0000 (15:47 +0000)]
Merge #2588

2588: Don't bother with focus range for navigation to locals r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't bother with focus range for navigation to locals
Aleksey Kladov [Wed, 18 Dec 2019 15:25:15 +0000 (16:25 +0100)]
Don't bother with focus range for navigation to locals

4 years agoMerge #2587
bors[bot] [Wed, 18 Dec 2019 15:04:08 +0000 (15:04 +0000)]
Merge #2587

2587: Refactor goto tests to always specify texts r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRefactor goto tests to always specify texts
Aleksey Kladov [Wed, 18 Dec 2019 14:33:36 +0000 (15:33 +0100)]
Refactor goto tests to always specify texts

4 years agoAdd blank lines for readability
Aleksey Kladov [Wed, 18 Dec 2019 13:52:58 +0000 (14:52 +0100)]
Add blank lines for readability

4 years agoMerge #2586
bors[bot] [Wed, 18 Dec 2019 14:47:04 +0000 (14:47 +0000)]
Merge #2586

2586: Make reformat hook actually reformat files r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMake reformat hook actually reformat files
Aleksey Kladov [Wed, 18 Dec 2019 14:40:48 +0000 (15:40 +0100)]
Make reformat hook actually reformat files

4 years agocargo fmt
Jeremy Kolb [Wed, 18 Dec 2019 14:11:47 +0000 (09:11 -0500)]
cargo fmt

4 years agoPass test
Jeremy Kolb [Wed, 18 Dec 2019 13:58:48 +0000 (08:58 -0500)]
Pass test

4 years agoMerge #2585
bors[bot] [Wed, 18 Dec 2019 13:56:36 +0000 (13:56 +0000)]
Merge #2585

2585: Cleanup Vim and NeoVim instructions. Fix #2579 r=oblitum a=oblitum

I took some freedom to remove additional tips that I simply considered unnecessary as I view it as responsibility of plugin's own docs.

Co-authored-by: Francisco Lopes <francisco@oblita.com>
4 years agoWIP: See through Macros for SignatureHelp
kjeremy [Mon, 18 Nov 2019 23:08:39 +0000 (18:08 -0500)]
WIP: See through Macros for SignatureHelp

Note: we meed to skip the trivia filter to make sure that
`covers!(call_info_bad_offset)` succeeds otherwise we exit call_info
too early.

Also the test doesn't pass: `FnCallNode::with_node` always detects
a MacroCall.

4 years agoMerge #2545
bors[bot] [Wed, 18 Dec 2019 11:47:50 +0000 (11:47 +0000)]
Merge #2545

2545: Add Token id to all tt::TokenTree r=matklad a=edwin0cheng

This PR try to add token id to all `tt::Leaf` and `tt::Delimiter`.

~~Some tests are failed now because of #2544~~

~~Still blocked by a test in goto-definition : see https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553~~

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoRefactoring
Edwin Cheng [Wed, 18 Dec 2019 03:47:26 +0000 (11:47 +0800)]
Refactoring

4 years agoRename range to by_kind
Edwin Cheng [Wed, 18 Dec 2019 03:36:10 +0000 (11:36 +0800)]
Rename range to by_kind

4 years agoAdd test for token map
Edwin Cheng [Fri, 13 Dec 2019 19:39:15 +0000 (03:39 +0800)]
Add test for token map

4 years agoFix shift id for delim and other tokens
Edwin Cheng [Fri, 13 Dec 2019 19:37:04 +0000 (03:37 +0800)]
Fix shift id for delim and other tokens

4 years agoAdd TokenTextRange
Edwin Cheng [Fri, 13 Dec 2019 15:55:51 +0000 (23:55 +0800)]
Add TokenTextRange

4 years agoAdd token id to delims
Edwin Cheng [Thu, 12 Dec 2019 17:41:44 +0000 (01:41 +0800)]
Add token id to delims

4 years agoAdd token ids for all tt::Leaf
Edwin Cheng [Thu, 12 Dec 2019 13:47:54 +0000 (21:47 +0800)]
Add token ids for all tt::Leaf

4 years agoMerge #2575
bors[bot] [Wed, 18 Dec 2019 03:03:51 +0000 (03:03 +0000)]
Merge #2575

2575: [VS Code Extension] Remap error location if it extracted inside macros r=edwin0cheng a=edwin0cheng

It should fix for #2569

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoUse substr instead of endswith
Edwin Cheng [Tue, 17 Dec 2019 13:43:19 +0000 (21:43 +0800)]
Use substr instead of endswith

4 years agoAdd tests
Edwin Cheng [Tue, 17 Dec 2019 05:50:08 +0000 (13:50 +0800)]
Add tests

4 years agoAdd macro span handling
Edwin Cheng [Tue, 17 Dec 2019 05:50:00 +0000 (13:50 +0800)]
Add macro span handling

4 years agoCleanup Vim and NeoVim instructions. Fix #2579
Francisco Lopes [Tue, 17 Dec 2019 23:47:20 +0000 (20:47 -0300)]
Cleanup Vim and NeoVim instructions. Fix #2579

4 years agoMerge #2583
bors[bot] [Tue, 17 Dec 2019 21:12:18 +0000 (21:12 +0000)]
Merge #2583

2583: Use prettier settings in ts-lint r=matklad a=edwin0cheng

This PR add `tslint-plugin-prettier` extension in ts-lint, which "runs prettier rules as tslint rules." and remove  `quotemark` from ts-lint and let prettier to handle it.

And also fix #2515

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agouse pretter settings in ts-lint
Edwin Cheng [Tue, 17 Dec 2019 15:48:26 +0000 (23:48 +0800)]
use pretter settings in ts-lint

4 years agoMerge #2582
bors[bot] [Tue, 17 Dec 2019 15:03:38 +0000 (15:03 +0000)]
Merge #2582

2582: Drop dead code r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop dead code
Aleksey Kladov [Tue, 17 Dec 2019 15:03:15 +0000 (16:03 +0100)]
Drop dead code

4 years agoMerge #2581
bors[bot] [Tue, 17 Dec 2019 14:39:07 +0000 (14:39 +0000)]
Merge #2581

2581: Refactor PathKind r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRefactor PathKind
Aleksey Kladov [Tue, 17 Dec 2019 14:38:28 +0000 (15:38 +0100)]
Refactor PathKind

4 years agoMerge #2580
bors[bot] [Tue, 17 Dec 2019 13:46:12 +0000 (13:46 +0000)]
Merge #2580

2580: Fix highlighting token names r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFix highlighting token names
Aleksey Kladov [Tue, 17 Dec 2019 13:43:37 +0000 (14:43 +0100)]
Fix highlighting token names

4 years agoMerge #2562
bors[bot] [Tue, 17 Dec 2019 13:37:32 +0000 (13:37 +0000)]
Merge #2562

2562: Fix NavigationTarget ranges r=matklad a=edwin0cheng

Fix the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553

This PR change the order for finding `full_range` of `focus_range` in following orders:
1. map both ranges to macro_call
2. map focus range to a token inside macro call, and full range to the whole of macro call
3. map both ranges to the whole of macro call

And fix the corresponding tests and make these tests easily to follow.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoMerge #2568
bors[bot] [Tue, 17 Dec 2019 13:28:37 +0000 (13:28 +0000)]
Merge #2568

2568: Add option to disable all-targets. r=matklad a=pftbest

Can be useful in embedded.

Co-authored-by: Vadzim Dambrouski <vadzim.dambrouski@promwad.com>
4 years agoMerge #2571
bors[bot] [Tue, 17 Dec 2019 13:19:59 +0000 (13:19 +0000)]
Merge #2571

2571: Fixed a typo in settings r=matklad a=omerbenamram

@lnicola found a typo in the description for one of the settings introduced in #2559.

Co-authored-by: Omer Ben-Amram <omerbenamram@gmail.com>
4 years agoMerge #2578
bors[bot] [Tue, 17 Dec 2019 11:42:19 +0000 (11:42 +0000)]
Merge #2578

2578: Default to client watching on VS Code r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDefault to client watching on VS Code
Aleksey Kladov [Tue, 17 Dec 2019 11:41:44 +0000 (12:41 +0100)]
Default to client watching on VS Code

4 years agoMerge #2577
bors[bot] [Tue, 17 Dec 2019 11:12:50 +0000 (11:12 +0000)]
Merge #2577

2577: Improve recovery for incomplete lambdas r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoImprove recovery for incomplete lambdas
Aleksey Kladov [Tue, 17 Dec 2019 11:11:01 +0000 (12:11 +0100)]
Improve recovery for incomplete lambdas

4 years agoMerge #2572
bors[bot] [Mon, 16 Dec 2019 17:47:43 +0000 (17:47 +0000)]
Merge #2572

2572: link website r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agolink website
Aleksey Kladov [Mon, 16 Dec 2019 17:41:03 +0000 (18:41 +0100)]
link website

4 years agoFixed a typo
Omer Ben-Amram [Mon, 16 Dec 2019 15:32:46 +0000 (17:32 +0200)]
Fixed a typo

thanks @lnicola

4 years agoFix formatting
Vadzim Dambrouski [Mon, 16 Dec 2019 03:31:38 +0000 (09:01 +0530)]
Fix formatting

4 years agoMerge #2567
bors[bot] [Sun, 15 Dec 2019 20:08:12 +0000 (20:08 +0000)]
Merge #2567

2567: Handle impl Trait more correctly r=flodiebold a=flodiebold

When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function.

So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoAdd test mark
Florian Diebold [Sun, 15 Dec 2019 20:06:08 +0000 (21:06 +0100)]
Add test mark

4 years agoAdd option to disable all-targets.
Vadzim Dambrouski [Sun, 15 Dec 2019 17:32:13 +0000 (23:02 +0530)]
Add option to disable all-targets.

Can be useful in embedded.

4 years agoHandle impl Trait more correctly
Florian Diebold [Sun, 15 Dec 2019 17:56:38 +0000 (18:56 +0100)]
Handle impl Trait more correctly

When calling a function, argument-position impl Trait is transparent; same for
return-position impl Trait when inside the function. So in these cases, we need
to represent that type not by `Ty::Opaque`, but by a type variable that can be
unified with whatever flows into there.

4 years agoAdd test for unifying impl Trait
Florian Diebold [Fri, 6 Dec 2019 11:45:00 +0000 (12:45 +0100)]
Add test for unifying impl Trait

4 years agoMerge #2565
bors[bot] [Sun, 15 Dec 2019 16:35:23 +0000 (16:35 +0000)]
Merge #2565

2565: Fixed syntax highlighting not refreshing on windows. r=matklad a=omerbenamram

I was encoutering the same probelm described in #1690.

It seems that events initiated by the frontend with `rust-analyzer/decorationsRequest` would go through.
So whenever a user switches tabs, highlighting will update.

However, when decorations are initiated by a notification with `rust-analyzer/publishDecorations`, it would fail on this check here https://github.com/rust-analyzer/rust-analyzer/blob/6cbd8a4a4bbca8a7656df9f3ef849acebbf9ef9b/editors/code/src/notifications/publish_decorations.ts#L15 (`targetEditor` will always be `undefined`).

This is because it's trying to match the uri `rust-analyzer` sends (which uses an uppercase drive letter) to the uri provided at `editor.document.uri.toString()`, which is both escaped (uses `%3a` for `:`), and uses a lowercase letter drive.

Aparrently this was an issue for some other extensions aswell - https://github.com/Microsoft/vscode/issues/68325.

But this is the defined behavior - https://github.com/microsoft/vscode/blob/c110d84460b3e45842a8fe753562341003595e1d/src/vs/vscode.d.ts#L1304

This fix is only relevant for windows.
I've opted for a server-side fix, since rust will always return uppercase letters for drives, there seems to be no other easy solution than manipulating the Url string before sending it to the frontend.

Closes #1690.

Co-authored-by: Omer Ben-Amram <omerbenamram@gmail.com>
4 years agoMerge #2566
bors[bot] [Sun, 15 Dec 2019 16:20:13 +0000 (16:20 +0000)]
Merge #2566

2566: Add a rudimentary json regex to get at information like `endLine` r=matklad a=oli-obk

Co-authored-by: Oliver Scherer <github35764891676564198441@oli-obk.de>
4 years agoProperly format json
Oliver Scherer [Sun, 15 Dec 2019 16:19:41 +0000 (17:19 +0100)]
Properly format json

4 years agoremove unnecessary turbofish.
Omer Ben-Amram [Sun, 15 Dec 2019 16:15:24 +0000 (18:15 +0200)]
remove unnecessary turbofish.

4 years agoAdd a rudimentary json regex to get at information like `endLine`
Oliver Scherer [Sun, 15 Dec 2019 16:12:52 +0000 (17:12 +0100)]
Add a rudimentary json regex to get at information like `endLine`

4 years agocfg gated tests that only work on windows.
Omer Ben-Amram [Sun, 15 Dec 2019 15:54:24 +0000 (17:54 +0200)]
cfg gated tests that only work on windows.

4 years agoimproved path checking to consider only paths that may contain a windows drive.
Omer Ben-Amram [Sun, 15 Dec 2019 15:46:00 +0000 (17:46 +0200)]
improved path checking to consider only paths that may contain a windows drive.

4 years ago`npm run fix`
Omer Ben-Amram [Sun, 15 Dec 2019 15:10:39 +0000 (17:10 +0200)]
`npm run fix`

4 years agomove import inside cfg block
Omer Ben-Amram [Sun, 15 Dec 2019 15:03:39 +0000 (17:03 +0200)]
move import inside cfg block