francodacosta / atom-php-getters-setters

automatically generate _Getters_ and _Setters_ for your php classes in the atom.io editor
MIT License
17 stars 10 forks source link

Change Template #31

Open eversonaraujo opened 6 years ago

eversonaraujo commented 6 years ago

Hi, when I change the template, and try to generate the code, the slashs aren't being interprete.

Nightbr commented 6 years ago

Same here:


\ \ \ \ /**
\ \ \ \ \ *\ Get\ the\ value\ of\ %description%
\ \ \ \ \ *
\ \ \ \ \ *\ @return\ %type%
\ \ \ \ \ */
\ \ \ \ %scope%\ function\ %methodName%()
\ \ \ \ {
\ \ \ \ \ \ \ \ return\ $this->%variable%;
\ \ \ \ }

and

\ \ \ \ /**
\ \ \ \ \ *\ Set\ the\ value\ of\ %description%
\ \ \ \ \ *
\ \ \ \ \ *\ @param\ %type%\ $%variable%
\ \ \ \ \ *
\ \ \ \ \ *\ @return\ self
\ \ \ \ \ */
\ \ \ \ %scope%\ function\ %methodName%(%typeHint%$%variable%)
\ \ \ \ {
\ \ \ \ \ \ \ \ $this->%variable%\ =\ $%variable%;

\ \ \ \ \ \ \ \ return\ $this;
\ \ \ \ }

When I tried to update template

Nightbr commented 6 years ago

related https://github.com/francodacosta/atom-php-getters-setters/issues/23

Wardevour commented 6 years ago

I made a pull request.

It looks like we're removing Unicode or otherwise unexpected characters from the end of each line, then replacing all spaces with '\\ '. I can't seem to figure out why.

carlosstenzel commented 6 years ago

@Wardevour altere o arquivo ~.atom/config.cson, consegui resolver meu problema assim. `.... "php-getters-setters": generateSettersFirst: true getterTemplate: ''' /**