Skip to content
Permalink
Browse files

Add reference, not type

Ref #1835
  • Loading branch information...
muglug committed Jun 23, 2019
1 parent 37ffd6d commit 766b1b0384e9a54d3fb77f45825feab9c0dc836a
Showing with 7 additions and 29 deletions.
  1. +0 −14 src/Psalm/Internal/Codebase/Analyzer.php
  2. +6 −14 src/Psalm/Type/Atomic.php
  3. +1 −1 tests/LanguageServer/SymbolLookupTest.php
@@ -1028,20 +1028,6 @@ public function addNodeType(
];
}
/**
* @return void
*/
public function addDocblockType(
string $file_path,
\Psalm\CodeLocation\DocblockTypeLocation $code_location,
string $docblock_type
) {
$this->type_map[$file_path][$code_location->raw_file_start] = [
$code_location->raw_file_end,
$docblock_type
];
}
/**
* @param array<string, string> $aliases
* @return void
@@ -355,14 +355,10 @@ public function check(
&& $this->offset_start !== null
&& $this->offset_end !== null
) {
$codebase->analyzer->addDocblockType(
$codebase->analyzer->addOffsetReference(
$source->getFilePath(),
new CodeLocation\DocblockTypeLocation(
$source,
$code_location->raw_file_start + $this->offset_start,
$code_location->raw_file_start + $this->offset_end,
$code_location->raw_line_number
),
$code_location->raw_file_start + $this->offset_start,
$code_location->raw_file_start + $this->offset_end,
$this->value
);
}
@@ -395,14 +391,10 @@ public function check(
&& $extra_type->offset_start !== null
&& $extra_type->offset_end !== null
) {
$codebase->analyzer->addDocblockType(
$codebase->analyzer->addOffsetReference(
$source->getFilePath(),
new CodeLocation\DocblockTypeLocation(
$source,
$code_location->raw_file_start + $extra_type->offset_start,
$code_location->raw_file_start + $extra_type->offset_end,
$code_location->raw_line_number
),
$code_location->raw_file_start + $extra_type->offset_start,
$code_location->raw_file_start + $extra_type->offset_end,
$extra_type->value
);
}
@@ -293,6 +293,6 @@ class A {
$this->assertNotNull($symbol_at_position);
$this->assertSame('type: Exception', $symbol_at_position[0]);
$this->assertSame('Exception', $symbol_at_position[0]);
}
}

0 comments on commit 766b1b0

Please sign in to comment.
You can’t perform that action at this time.