Skip to content

Method location wrong? #141

Closed
Closed
@czosel

Description

@czosel

PHP Script :

<?php

class Foo
{
    public function setTitle($title){}

    /**
     * Comment
     */
    public function someMethod() {}
}

AST Structure of first method:

        {
          "kind": "method",
          "loc": {
            "source": null,
            "start": {
              "line": 5,
              "column": 11,
              "offset": 30
            },
            "end": {
              "line": 9,
              "column": 7,
              "offset": 89
            }
          }

I would have expected the end location of the first method to be on line 5 as well (instead of line 9)

prettier/plugin-php#250

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions